/* HMI - dark industrial theme, built for gloved fingers on Elo touchscreens */
:root {
  /* theme tokens - set live by js/theme.js from the chosen theme; these are the Night Shift defaults */
  --bg: #070b10; --stage-bg: #0b1117; --panel: #131c26; --panel2: #1a2531; --sunk: #0e151d; --input: #0a1118;
  --line: #2a3a4b; --line2: #1d2a38; --text: #e3ebf3; --text2: #cbd6e2; --dim: #8aa0b6;
  --accent: #39b3ff; --accent-text: #061019; --sel: #16324c; --btn: #1d6fb8; --header: #0c131b; --nav: #0c131b; --glow: #0f1822;
  --run: #22c55e; --off: #5d6f82; --fault: #ef4444; --warn: #f59e0b; --hand: #f59e0b; --cotton: #f4f1e8;
  --font: Bahnschrift, "DIN Alternate", "Segoe UI", system-ui, sans-serif;
  --font-num: var(--font); --ui-zoom: 1;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
button { font-family: inherit; }
#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; } /* dvh: the part of a phone screen the browser's address bar leaves free */

/* ---------- top bar */
#top { display: flex; align-items: center; gap: 18px; height: 64px; padding: 0 14px; background: linear-gradient(var(--header), var(--nav)); border-bottom: 1px solid var(--line2); flex: none; }
#brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
#brand b { display: block; font-size: 19px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
#brand small { display: block; color: var(--dim); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.logoplate.none { background: none; box-shadow: none; } .logoplate.dark { background: #0b1117; }
.logoplate { background: var(--cotton); border-radius: 6px; padding: 3px 5px; height: 54px; display: flex; align-items: center; box-shadow: 0 0 0 1px #0006; }
.logoplate img { height: 48px; display: block; }
#scrname { flex: 1; min-width: 90px; text-align: center; font-size: 22px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topright { display: flex; align-items: center; gap: 10px; }
.pill { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 14px; font-weight: 700; letter-spacing: .05em; cursor: pointer; }
.pill.ok { color: var(--run); border-color: var(--line); }
.pill.warn { color: #fde68a; border-color: #92400e; background: #2a1d0a; }
.pill.bad { color: #fff; border-color: #b91c1c; background: #7f1d1d; }
#clock { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; line-height: 1; min-width: 118px; }
#clock small { display: block; font-size: 12px; color: var(--dim); font-weight: 400; margin-top: 3px; }
.editbtn { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--dim); font-size: 15px; cursor: pointer; }
.editmode .editbtn { display: none; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--off); margin-right: 6px; vertical-align: middle; }
.dot.online { background: #22c55e; box-shadow: 0 0 8px #22c55e; } /* comms OK stays green in every theme */
.dot.error, .dot.stopped { background: var(--fault); box-shadow: 0 0 8px var(--fault); }
.dot.connecting { background: var(--warn); }

/* ---------- stage */
#work { flex: 1; display: flex; min-height: 0; }
#viewport { flex: 1; position: relative; overflow: hidden; background: radial-gradient(circle at 50% 0%, var(--glow), var(--bg) 80%); }
#stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: var(--stage-bg); overflow: hidden; }
.emptyscr { position: absolute; inset: 0; margin: auto; width: min(560px, 90%); height: max-content; padding: 26px 30px; border: 1px dashed var(--line2, #2a3a4b); border-radius: 14px; color: var(--muted, #8aa0b6); font-size: 17px; line-height: 1.5; } .emptyscr > b { display: block; font-size: 22px; color: var(--text, #e3ebf3); margin-bottom: 8px; } .emptyscr ol { margin: 0 0 16px; padding-left: 22px; } .emptyscr b { color: var(--text, #e3ebf3); } .pilllist { position: relative; height: min(60vh, 440px); }
.wd { position: absolute; }
.wd.wd-nodata { filter: grayscale(1); opacity: .55; } .wd.wd-nodata::after { content: 'NO DATA'; position: absolute; top: 2px; right: 2px; z-index: 6; padding: 1px 5px; border-radius: 4px; background: #7f1d1d; color: #fff; font: 700 10px/14px system-ui, sans-serif; pointer-events: none; }
.wsvg { display: block; overflow: visible; }
.w-missing { width: 100%; height: 100%; border: 1px dashed var(--fault); color: var(--fault); font-size: 12px; padding: 4px; }

/* ---------- bottom nav */
#nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 5px; padding: 6px 8px; background: var(--nav); border-top: 1px solid var(--line2); flex: none; }
.navb { height: 48px; padding: 0 6px; border: 0; border-radius: 10px; background: var(--panel2); color: var(--text2); font-size: 14px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; position: relative; cursor: pointer; line-height: 1.05; }
.navb::before { content: ''; position: absolute; left: 10px; right: 10px; top: 0; height: 4px; border-radius: 0 0 4px 4px; background: var(--c); opacity: .85; }
.navb.on { background: var(--c); color: var(--ct, var(--accent-text)); }
.navb.on::before { display: none; }
.navb:active { filter: brightness(1.3); }

/* ---------- widgets */
.w-label { width: 100%; height: 100%; display: flex; align-items: center; padding: 0 8px; line-height: 1.1; overflow: hidden; }
.w-panel { width: 100%; height: 100%; position: relative; overflow: hidden; box-shadow: inset 0 1px 0 #ffffff0a; }
.w-panel-title { position: absolute; left: 14px; top: 9px; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.w-panel-accent { position: absolute; left: 0; right: 0; top: 0; height: 3px; }
.w-cap { font-size: 12px; color: var(--dim); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-value { width: 100%; height: 100%; border-radius: 10px; border: 1px solid var(--line); padding: 6px 10px; display: flex; flex-direction: column; justify-content: center; }
.w-num { font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.05; white-space: nowrap; }
.w-units { font-size: .5em; color: var(--dim); margin-left: 4px; font-weight: 400; }
.w-entry { width: 100%; height: 100%; display: flex; flex-direction: column; gap: 3px; }
.w-entry-row { flex: 1; display: flex; gap: 4px; min-height: 0; }
.w-field { flex: 1; min-width: 0; border-radius: 10px; border: 2px solid var(--btn); background: var(--input); color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; }
.w-field small { font-size: 11px; color: var(--dim); font-weight: 400; }
.w-field:active { background: #0e2a40; }
.w-arrow { width: 46px; flex: none; border-radius: 10px; border: 1px solid var(--line); background: linear-gradient(#243343, #17222e); color: #cfe3f5; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.w-arrow:active { background: #2c4a66; }
.w-btn { width: 100%; height: 100%; border-radius: 12px; border: 1px solid #0008; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 82%, #fff 18%), var(--c) 55%, color-mix(in srgb, var(--c) 75%, #000 25%)); box-shadow: inset 0 1px 0 #ffffff40, 0 3px 0 #0009, 0 4px 10px #0006; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; cursor: pointer; line-height: 1.1; padding: 2px 6px; position: relative; }
.w-btn:active, .w-btn.pressed { transform: translateY(2px); box-shadow: inset 0 2px 6px #0008, 0 1px 0 #0009; filter: brightness(1.15); }
.w-btn.lit { background: linear-gradient(180deg, color-mix(in srgb, var(--lit, var(--c)) 70%, #fff 30%), var(--lit, var(--c))); box-shadow: 0 0 16px color-mix(in srgb, var(--lit, var(--c)) 70%, transparent), inset 0 1px 0 #fff6, 0 3px 0 #0009; }
.w-btn.small { height: 40px; font-size: 13px; padding: 0 12px; border-radius: 9px; width: auto; }
.w-btn.nav { display: flex; align-items: center; justify-content: center; gap: 8px; }
.w-navarrow { opacity: .8; display: flex; }
.w-lamp { width: 100%; height: 100%; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.w-lamp.col { flex-direction: column; justify-content: center; gap: 4px; text-align: center; }
.w-lampdot { flex: none; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 40%, #fff 60%), var(--c) 45%, color-mix(in srgb, var(--c) 60%, #000 40%)); border: 2px solid #0009; }
.w-ms { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; font-weight: 800; letter-spacing: .06em; line-height: 1.15; text-transform: uppercase; box-shadow: inset 0 1px 0 #ffffff22; }
.w-hoa { width: 100%; height: 100%; display: flex; flex-direction: column; gap: 3px; }
.w-segs { flex: 1; display: flex; border-radius: 10px; overflow: hidden; border: 1px solid #000a; min-height: 0; background: var(--input); gap: 2px; padding: 2px; }
.w-seg { flex: 1; border: 0; border-radius: 8px; background: var(--panel2); color: var(--dim); font-weight: 800; font-size: 13px; letter-spacing: .05em; cursor: pointer; }
.w-seg:active { filter: brightness(1.4); }
.w-seg.on { color: var(--accent-ink, var(--accent-text)); box-shadow: inset 0 1px 0 #fff7; }
.w-seg.on.hand { background: var(--hand); color: var(--warn-ink, #fff); }
.w-seg.on.off { background: #94a3b8; color: #0b1117; }
.w-seg.on.auto { background: var(--run); color: var(--run-ink, #fff); }
.w-segs.big { height: 64px; flex: none; }
.w-segs.big .w-seg { font-size: 18px; }
.w-clock { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.w-clock small { font-size: .5em; color: var(--dim); margin-top: 4px; font-weight: 400; }
.w-image { width: 100%; height: 100%; display: flex; }
.w-image img { width: 100%; height: 100%; }
.w-imgph { flex: 1; border: 2px dashed var(--line); border-radius: 10px; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--dim); font-size: 13px; padding: 8px; }
.w-wordmark { width: 100%; height: 100%; display: flex; align-items: center; gap: 12px; }
.w-wordmark b { display: block; font-size: 22px; text-transform: uppercase; letter-spacing: .05em; }
.w-wordmark small { color: var(--dim); font-size: 13px; }
.w-logoplate { width: 100%; height: 100%; background: var(--cotton); border-radius: 10px; padding: 6px; display: flex; box-shadow: 0 4px 18px #0008; }
.w-logoplate img { width: 100%; height: 100%; object-fit: contain; }
.w-equip { width: 100%; height: 100%; cursor: pointer; }
.w-equip:active { filter: brightness(1.25); }

.w-trend { width: 100%; height: 100%; background: var(--input); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
.w-trend-head { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-bottom: 1px solid var(--line2); font-size: 13px; }
.w-trend-head b { letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.w-tspan { display: flex; gap: 2px; background: var(--input); border-radius: 8px; padding: 2px; }
.w-tspan button { height: 30px; min-width: 40px; border: 0; border-radius: 6px; background: transparent; color: var(--dim); font-weight: 700; font-size: 12px; cursor: pointer; }
.w-tspan button.on { background: var(--btn); color: #fff; }
.w-tlink { width: 34px; height: 30px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel2); color: var(--accent); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.w-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-left: auto; }
.w-legend i { font-style: normal; display: flex; align-items: center; gap: 5px; color: var(--dim); }
.w-legend i::before { content: ''; width: 12px; height: 3px; border-radius: 2px; background: var(--c); }
.w-legend em { font-style: normal; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.w-trend-plot { flex: 1; min-height: 0; padding: 2px; }

/* cards */
.w-mcard { width: 100%; height: 100%; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; padding: 8px; border-left: 5px solid var(--off); }
.w-mcard.run { border-left-color: var(--run); }
.w-mcard.fault { border-left-color: var(--fault); background: #2a1113; }
.w-mcard-h { display: flex; align-items: center; gap: 8px; min-width: 0; }
.w-mnum { flex: none; min-width: 26px; height: 22px; padding: 0 5px; border-radius: 6px; background: var(--input); color: var(--dim); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.w-mname { flex: 1; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-mst { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--dim); }
.run .w-mst { color: var(--run); } .fault .w-mst { color: #fca5a5; }
.w-mcard .w-segs { flex: 1; }
.w-mcard-f { display: flex; gap: 6px; }
.w-mcard-f div { flex: 1; background: var(--input); border-radius: 6px; padding: 2px 6px; display: flex; justify-content: space-between; align-items: baseline; }
.w-mcard-f span { font-size: 10px; color: var(--dim); font-weight: 700; }
.w-mcard-f b { font-size: 14px; font-variant-numeric: tabular-nums; }

.w-vcard { width: 100%; height: 100%; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; padding: 8px; border-top: 4px solid var(--off); }
.w-vcard.run { border-top-color: var(--run); } .w-vcard.fault { border-top-color: var(--fault); background: #2a1113; }
.w-vcard-h { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.w-vcard-h b { font-size: 15px; line-height: 1.1; }
.w-vcard-h span { font-size: 11px; color: var(--warn); white-space: nowrap; font-weight: 700; }
.w-vbars { flex: 1; display: flex; gap: 8px; min-height: 0; }
.w-vbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.w-vbar-t { flex: 1; width: 100%; border-radius: 6px; background: var(--input); border: 1px solid var(--line2); position: relative; overflow: hidden; }
.w-vbar-f { position: absolute; left: 2px; right: 2px; bottom: 2px; border-radius: 4px; background: linear-gradient(color-mix(in srgb, var(--c) 70%, #fff 30%), var(--c)); transition: height .4s; }
.w-vbar b { font-size: 15px; font-variant-numeric: tabular-nums; }
.w-vbar span { font-size: 10px; color: var(--dim); font-weight: 700; text-transform: uppercase; }
.w-vsp { display: flex; gap: 4px; height: 46px; flex: none; }
.w-vsp .w-field { font-size: 18px; flex-direction: column; gap: 0; line-height: 1; overflow: hidden; }
.w-vsp .w-field small { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.w-vsp.stacked { flex-direction: column; height: auto; }
.w-vsp.stacked .w-field { height: 44px; width: 100%; flex: none; }
.w-vsp-arrows { display: flex; gap: 4px; } .w-vsp-arrows .w-arrow { flex: 1; width: auto; height: 34px; }

.w-acard { width: 100%; height: 100%; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.w-acard.fault { background: #2a1113; border-color: var(--fault); }
.w-acard-h { display: flex; gap: 6px; align-items: center; }
.w-acard-h i { font-style: normal; font-size: 11px; background: var(--input); color: var(--dim); border-radius: 5px; padding: 1px 6px; }
.w-acard-h b { font-size: 14px; line-height: 1.1; }
.w-acard-body { flex: 1; display: flex; gap: 8px; min-height: 0; }
.w-atube { width: 38%; border-radius: 8px; background: var(--input); border: 1px solid var(--line2); position: relative; }
.w-afill { position: absolute; left: 3px; right: 3px; bottom: 3px; border-radius: 5px; background: linear-gradient(color-mix(in srgb, var(--c, #22c55e) 70%, #fff 30%), var(--c, #22c55e)); max-height: calc(100% - 6px); transition: height .4s; }
.w-amk { position: absolute; left: -3px; right: -3px; height: 0; border-top: 2px dashed var(--c); }
.w-amk span { position: absolute; left: calc(100% + 6px); top: -8px; font-size: 10px; font-weight: 700; color: var(--c); white-space: nowrap; }
.w-aside { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; gap: 6px; }
.w-aside.top { justify-content: flex-start; }
.w-alist { display: flex; flex-direction: column; gap: 2px; font-size: 11px; font-variant-numeric: tabular-nums; }
.w-alist div { display: flex; justify-content: space-between; gap: 6px; color: var(--c); border-bottom: 1px dashed color-mix(in srgb, var(--c) 50%, transparent); padding-bottom: 1px; }
.w-alist span { font-weight: 800; letter-spacing: .04em; } .w-alist b { font-weight: 700; }
.w-aval { display: flex; flex-direction: column; align-items: flex-end; }
.w-aval b { font-size: 26px; font-variant-numeric: tabular-nums; }
.w-aval span { color: var(--dim); font-size: 12px; }
.w-aval em { font-style: normal; color: var(--fault); font-weight: 800; font-size: 12px; }
.w-acard .w-btn.small { width: 100%; }

.w-scard { width: 100%; height: 100%; border-radius: 14px; background: linear-gradient(var(--panel2), var(--panel)); border: 1px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.w-scard.fault { border-color: var(--fault); background: #2a1113; }
.w-scard-h { display: flex; align-items: center; gap: 10px; }
.w-scard-h .w-mnum { font-size: 16px; height: 30px; min-width: 34px; background: var(--accent); color: var(--accent-text); }
.w-scard-h b { font-size: 18px; letter-spacing: .06em; text-transform: uppercase; flex: 1; }
.w-link { border: 1px solid var(--line); background: transparent; color: var(--accent); border-radius: 8px; height: 34px; padding: 0 10px; font-weight: 700; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.w-srow { display: flex; align-items: center; gap: 10px; flex: 1; min-height: 0; }
.w-srow span { width: 78px; font-size: 12px; color: var(--dim); font-weight: 700; text-transform: uppercase; }
.w-srow b { width: 62px; text-align: right; font-size: 20px; font-variant-numeric: tabular-nums; }
.w-strack { flex: 1; height: 60%; max-height: 26px; min-height: 12px; background: var(--input); border: 1px solid var(--line2); border-radius: 6px; position: relative; }
.w-sfill { position: absolute; left: 2px; top: 2px; bottom: 2px; border-radius: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 60%, #000 40%), var(--c)); transition: width .4s; max-width: calc(100% - 4px); }
.w-ssp { position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1px; background: var(--fault); border-radius: 2px; box-shadow: 0 0 6px var(--fault); }
.w-scard-f { display: flex; align-items: center; gap: 6px; height: 44px; flex: none; overflow: hidden; }
.w-scard-f .w-btn.small { height: 40px; min-width: 54px; padding: 0 8px; }
.w-scard-f .w-segs { flex: 1 1 120px; max-width: 170px; height: 40px; }
.w-pill { flex: none; font-size: 10px; font-weight: 800; letter-spacing: .05em; padding: 6px 8px; border-radius: 8px; background: var(--panel2); color: var(--dim); white-space: nowrap; }
.w-pill.ok { background: #14532d; color: #bbf7d0; }

.w-abanner { width: 100%; height: 100%; border-radius: 10px; display: flex; align-items: center; gap: 12px; padding: 0 16px; font-weight: 800; background: #7f1d1d; color: #fff; cursor: pointer; overflow: hidden; white-space: nowrap; border: 1px solid #b91c1c; }
.w-abanner span { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.w-abanner em { font-style: normal; font-size: .7em; background: #0005; border-radius: 6px; padding: 3px 8px; }
.w-abanner.ok { background: #0f2418; border-color: #14532d; color: #86efac; font-weight: 700; }
.w-abanner.acked { background: #3b1414; }
.w-abanner.p3 { background: #78350f; border-color: #b45309; }

.w-alist { width: 100%; height: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
.w-alist-h { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.w-alist-h b { font-size: 16px; letter-spacing: .08em; text-transform: uppercase; }
.w-alist-h span { color: var(--dim); flex: 1; }
.w-alist-b { flex: 1; overflow: auto; } .w-alist-b tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--panel2, #1a2531) 70%, transparent); }
.w-alist table { width: 100%; border-collapse: collapse; font-size: 15px; }
.w-alist th { text-align: left; color: var(--dim); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 8px 10px; position: sticky; top: 0; background: var(--panel); }
.w-alist td { padding: 8px 10px; border-top: 1px solid var(--line2); }
.w-alist tr.act.unack td { background: #3b1113; color: #fff; }
.w-alist tr.act.ack td { color: #fca5a5; }
.w-alist tr.rtn td { color: var(--dim); }
.w-alist td.none { text-align: center; color: var(--dim); padding: 30px; }

/* animation */
.spin { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.prs-box.turning { transform-box: fill-box; transform-origin: center; animation: prsturn 2.4s ease-in-out infinite; }
@keyframes prsturn { 0% { transform: scaleX(1); } 50% { transform: scaleX(-1); } 100% { transform: scaleX(1); } }
.prs-eject { animation: prseject 1.2s ease-in-out infinite alternate; }
@keyframes prseject { from { transform: translateX(0); } to { transform: translateX(10px); } }
.belt { animation: belt .8s linear infinite; }
@keyframes belt { to { transform: translateX(24px); } }
.flow { animation: flow .9s linear infinite; }
.flow.rev { animation-direction: reverse; }
@keyframes flow { to { stroke-dashoffset: -22; } }
.blink { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.blinkb { animation: blinkb 1s ease-in-out infinite; }
@keyframes blinkb { 50% { filter: brightness(1.6); } }

/* ---------- modals */
.modal-back { position: fixed; inset: 0; background: #000b; display: flex; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(3px); }
.modal { background: var(--sunk); border: 1px solid var(--line); border-radius: 18px; padding: 20px; min-width: 360px; max-width: 94vw; max-height: 92vh; overflow: auto; box-shadow: 0 30px 80px #000c; user-select: text; }
.modal.small { width: 440px; }
.modal.wide { width: min(1180px, 96vw); }
.modal h3 { margin: 0 0 12px; font-size: 20px; letter-spacing: .04em; }
.modal h4 { margin: 18px 0 6px; }
.modal p.big { font-size: 20px; }
.mrow { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.mb { height: 52px; padding: 0 22px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 16px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; }
.mb.pri { background: var(--btn); border-color: var(--btn); color: #fff; }
.mb.wide { width: 100%; justify-content: center; margin-top: 10px; height: 60px; font-size: 20px; }
.bigin, .modal input:not([type=checkbox]):not([type=color]), .modal select { height: 44px; background: var(--input); border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 0 12px; font-size: 16px; font-family: inherit; }
.bigin { width: 100%; }
.keypad { width: 400px; }
.kp-disp { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; height: 76px; background: #06101a; border: 2px solid var(--btn); border-radius: 12px; padding: 0 16px; font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kp-disp .fresh { color: var(--dim); }
.kp-disp small { font-size: 16px; color: var(--dim); }
.kp-lim { color: var(--dim); font-size: 13px; text-align: right; margin: 6px 2px 10px; min-height: 16px; }
.kp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpk { height: 66px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(var(--line2), var(--panel2)); color: var(--text); font-size: 26px; font-weight: 700; cursor: pointer; }
.kpk:active { background: #2e4d6b; }
.kpk.alt { font-size: 17px; color: var(--dim); }
.faceplate { width: 480px; }
.fp-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.fp-h b { font-size: 22px; flex: 1; }
.fp-st { font-weight: 800; padding: 6px 12px; border-radius: 8px; background: #334155; letter-spacing: .06em; }
.fp-st.run { background: #14532d; color: #bbf7d0; } .fp-st.fault { background: #7f1d1d; color: #fff; }
.fp-x { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 20px; cursor: pointer; flex: none; }
.fp-g { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fp-g div { background: var(--input); border-radius: 12px; padding: 10px 14px; }
.fp-g span { display: block; color: var(--dim); font-size: 13px; font-weight: 700; text-transform: uppercase; }
.fp-g b { font-size: 34px; font-variant-numeric: tabular-nums; }
.fp-sec { margin: 16px 0 6px; color: var(--dim); font-weight: 700; text-transform: uppercase; font-size: 13px; letter-spacing: .08em; }
.fp-btns { display: flex; gap: 10px; margin-top: 16px; }
.fp-btns .w-btn { height: 70px; font-size: 20px; }
.dim { color: var(--dim); } .small { font-size: 13px; } .pad { padding: 16px; }

#lostbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 300; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 16px; min-height: 64px; padding: 10px 18px; background: #7f1d1d; color: #fff; border-top: 3px solid #fca5a5; font-size: 18px; line-height: 1.3; box-shadow: 0 -8px 30px #000a; animation: lostpulse 1.6s ease-in-out infinite; }
#lostbar b { font-size: 22px; letter-spacing: .12em; }
#lostbar .dot { width: 16px; height: 16px; margin: 0; }
@keyframes lostpulse { 0%, 100% { background: #7f1d1d; } 50% { background: #a31b1b; } }
body.lost #stage, body.lost .faceplate { filter: saturate(.3) brightness(.8); }
body.lost #toasts { bottom: 100px; }
#toasts { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; pointer-events: none; }
.toast { background: #1e293b; color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 16px; font-weight: 600; box-shadow: 0 10px 30px #000a; transition: opacity .4s, transform .4s; border: 1px solid var(--line); }
.toast.ok { background: #14532d; border-color: #16a34a; } .toast.bad { background: #7f1d1d; border-color: #dc2626; }
.toast.out { opacity: 0; transform: translateY(10px); }
.fatal { position: fixed; inset: auto 20px 20px 20px; background: #7f1d1d; padding: 16px; border-radius: 12px; font-size: 18px; }

/* ---------- editor */
#etool, #lib, #props { display: none; }
.editmode #top { display: none; }
.editmode #etool { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; background: #0f1a26; border-bottom: 1px solid #22415f; flex: none; }
.editmode #lib { display: block; overflow-x: hidden; width: 250px; flex: none; overflow-y: auto; background: var(--sunk); border-right: 1px solid var(--line); padding: 10px; }
.editmode #props { display: block; width: 320px; flex: none; overflow-y: auto; background: var(--sunk); border-left: 1px solid var(--line); padding: 12px; user-select: text; }
.editmode #nav { pointer-events: none; opacity: .5; }
.editmode .wd * { pointer-events: none !important; }
.editmode .wd { cursor: move; }
.eg { display: flex; gap: 4px; align-items: center; padding-right: 8px; border-right: 1px solid var(--line2); }
.eg.right { margin-left: auto; border: 0; }
.eb { height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; }
.eb:disabled { opacity: .35; cursor: default; }
.eb.on { background: var(--btn); border-color: var(--btn); }
.eb.pri { background: var(--btn); border-color: var(--btn); color: #fff; }
.eb.danger { color: #fca5a5; border-color: #7f1d1d; }
.eb.flex { flex: 1; justify-content: flex-start; }
.eb.pulse { animation: blinkb 1.4s infinite; }
.esel { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 13px; }
.esel select { height: 38px; background: var(--input); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 0 8px; font-size: 15px; max-width: 220px; font-family: inherit; }
#selo { position: absolute; inset: 0; pointer-events: none; z-index: 10000; background-image: linear-gradient(#ffffff08 1px, transparent 1px), linear-gradient(90deg, #ffffff08 1px, transparent 1px); background-size: var(--g, 10px) var(--g, 10px); }
.selbox { position: absolute; outline: 2px solid var(--accent); outline-offset: 1px; box-shadow: 0 0 0 4px #39b3ff22; }
.hdl { position: absolute; width: 22px; height: 22px; border-radius: 6px; background: #fff; border: 3px solid var(--accent); pointer-events: auto; }
.selinfo { position: absolute; font-size: 12px; background: var(--btn); color: #fff; padding: 2px 6px; border-radius: 5px; white-space: nowrap; }
.marq { position: absolute; border: 1.5px dashed var(--accent); background: #39b3ff14; }
.libhead { display: flex; flex-direction: column; gap: 8px; }
.libhead input { height: 40px; border-radius: 9px; border: 1px solid var(--line); background: var(--input); color: var(--text); padding: 0 10px; font-size: 15px; font-family: inherit; }
.libhint { font-size: 12px; color: var(--dim); margin: 8px 0; }
#lib details { margin-bottom: 8px; }
#lib summary { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); padding: 6px 2px; cursor: pointer; }
.libgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.libitem { background: #141e29; border: 1px solid var(--line2); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: grab; touch-action: none; position: relative; }
.libitem:active { border-color: var(--accent); }
.libitem > span { font-size: 11px; text-align: center; line-height: 1.1; color: #c6d3df; }
.libthumb { width: 100%; height: 66px; position: relative; overflow: hidden; pointer-events: none; }
.libthumb.tpl { font-size: 12px; color: var(--dim); border: 1px dashed var(--line); border-radius: 8px; }
.thumbin { position: absolute; left: 50%; top: 50%; transform-origin: center; }
.libdel { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border-radius: 6px; border: 0; background: #7f1d1d; color: #fff; cursor: pointer; }
.ghost { position: fixed; z-index: 300; pointer-events: none; transform: translate(-50%, -50%); width: 110px; padding: 6px; background: #1d6fb8cc; border-radius: 12px; display: none; text-align: center; font-size: 12px; }
.ph { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.ph b { font-size: 17px; }
.pgrp { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.pgrp.xywh { flex-direction: row; gap: 6px; }
.xywh label { flex: 1; display: flex; flex-direction: column; font-size: 11px; color: var(--dim); gap: 2px; }
#props input:not([type=checkbox]):not([type=color]), #props select { height: 38px; width: 100%; background: var(--input); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 0 8px; font-size: 14px; font-family: inherit; min-width: 0; }
.plbl { font-size: 12px; color: var(--dim); margin-top: 6px; display: block; }
label.pchk { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; margin-top: 8px; width: auto; height: auto; border: 0; background: none; color: var(--text); }
label.pchk input { width: 22px; height: 22px; flex: none; }
.pcolor, .ptag { display: flex; gap: 4px; align-items: center; }
.pcolor input[type=color] { width: 44px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--input); padding: 2px; flex: none; }
.ptag .eb, .pcolor .eb { flex: none; }
.plive { font-size: 12px; color: var(--dim); padding: 2px 4px; }
.plive b { color: #86efac; }
.upl { cursor: pointer; }
.plist { display: flex; flex-direction: column; gap: 4px; }
.prow { display: flex; gap: 3px; align-items: center; }
.prow input[type=color] { width: 32px; height: 34px; flex: none; border: 1px solid var(--line); border-radius: 6px; padding: 1px; background: var(--input); }
.prow .eb { height: 34px; padding: 0 8px; }
.mini { font-size: 10px; display: flex; align-items: center; gap: 2px; color: var(--dim); }
.btnrow { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.scrlist, .bklist { display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow: auto; margin: 4px 0 8px; }
.scrrow { display: flex; gap: 4px; align-items: center; }
.scrrow.on .eb.flex { border-color: var(--accent); color: var(--text); }
/* tag picker */
.tagpicker { width: min(900px, 96vw); height: min(760px, 92vh); display: flex; }
.tp { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; }
.tp-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tp-h h3 { margin: 0; }
.tp-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tp-tab { border: 1px solid var(--line); background: var(--panel2); color: var(--text); border-radius: 10px; padding: 6px 14px; text-align: left; cursor: pointer; font-weight: 700; font-size: 15px; }
.tp-tab small { display: block; color: var(--dim); font-weight: 400; font-size: 12px; }
.tp-tab.on { background: var(--btn); border-color: var(--accent); }
.tp-bar { display: flex; gap: 8px; margin-bottom: 8px; }
.tp-bar .tp-q { flex: 1; }
.tp-list { flex: 1; overflow: auto; background: var(--input); border: 1px solid var(--line); border-radius: 12px; min-height: 0; }
.tp-row { display: flex; align-items: center; gap: 8px; min-height: 42px; padding-right: 12px; border-bottom: 1px solid var(--panel2); cursor: pointer; font-size: 15px; }
.tp-row:hover { background: #121d29; }
.tp-row.on { background: var(--btn); }
.tp-exp { width: 26px; text-align: center; color: var(--accent); font-size: 16px; }
.tp-n { flex: 1; font-family: Consolas, monospace; }
.tp-t { color: var(--dim); font-size: 12px; font-family: Consolas, monospace; }
.tp-foot { display: flex; gap: 10px; align-items: flex-end; margin-top: 10px; flex-wrap: wrap; }
.tp-foot label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--dim); min-width: 240px; }
.tp-foot input { font-family: Consolas, monospace !important; }
.tp-live { font-size: 14px; color: var(--dim); align-self: center; }
.tp-live b { color: #86efac; }
.etable-wrap { overflow: auto; max-height: 60vh; }
.etable { width: 100%; border-collapse: collapse; font-size: 14px; }
.etable th { text-align: left; font-size: 12px; color: var(--dim); padding: 6px; }
.etable td { padding: 4px 6px; border-top: 1px solid var(--line2); vertical-align: middle; }
.etable input:not([type=checkbox]), .etable select { height: 38px !important; font-size: 14px !important; }
.sgrid { display: grid; grid-template-columns: 300px 1fr; gap: 8px 14px; align-items: center; }
.sgrid .plbl { margin: 0; }

/* ---------- co-brand */
.poweredby { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 48px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 10px; background: var(--sunk); cursor: pointer; flex: none; }
.poweredby small { font-size: 8.5px; letter-spacing: .16em; color: var(--dim); font-weight: 700; }
.poweredby img { height: 22px; display: block; }
.editmode .poweredby { display: none; }
.about { width: 520px; text-align: center; }
.about .acs { width: 340px; margin: 6px auto 4px; display: block; }
.about .about-logo { height: 120px; background: var(--cotton); border-radius: 10px; padding: 6px; }
.about p { color: var(--dim); margin: 6px 0; }
.about .row2 { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 12px 0; }
.w-acs { width: 100%; height: 100%; border-radius: 12px; background: var(--sunk); border: 1px solid var(--line2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; text-align: center; }
.w-acs small { font-size: 11px; letter-spacing: .18em; color: var(--dim); font-weight: 700; }
.w-acs img { max-width: 92%; max-height: 62%; object-fit: contain; }
.w-acs span { font-size: 12px; color: var(--dim); }

@media (max-width: 1450px) {
  #brand > div { display: none; }
  .userbtn span { max-width: 96px; }
  .lockbtn span { display: none; }
  body.readonly .lockbtn span { display: inline; }
  #top { gap: 10px; }
  .pill { padding: 0 10px; font-size: 12px; }
  #scrname { font-size: 19px; }
}

/* ---------- security */
.userbtn, .lockbtn { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--dim); cursor: pointer; flex: none; text-align: left; }
.userbtn span { display: flex; flex-direction: column; line-height: 1.1; max-width: 130px; }
.userbtn b { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbtn small { font-size: 11px; color: var(--dim); }
.userbtn.in { border-color: var(--btn); }
.lockbtn span { font-size: 13px; font-weight: 800; letter-spacing: .06em; }
.lockbtn.on { background: #7f1d1d; border-color: #ef4444; color: #fff; animation: blinkb 2s infinite; }
.editmode .userbtn, .editmode .lockbtn { display: none; }
body.mobilero #stage [data-act]:not([data-act="nav"]):not([data-act="face"]):not([data-act="tspan"]):not([data-act="histopen"]):not([data-act="about"]):not([data-act="why"]),
body.readonly #stage [data-act]:not([data-act="nav"]):not([data-act="face"]):not([data-act="tspan"]):not([data-act="histopen"]):not([data-act="about"]),
body.nocontrol #stage [data-act]:not([data-act="nav"]):not([data-act="face"]):not([data-act="tspan"]):not([data-act="histopen"]):not([data-act="about"]),
body.mobilero .faceplate [data-act]:not([data-act="why"]), body.readonly .faceplate [data-act], body.nocontrol .faceplate [data-act] { filter: saturate(.25) brightness(.8); cursor: not-allowed; }
body.readonly #viewport { box-shadow: inset 0 0 0 4px #7f1d1d; }
body.readonly #viewport::after { content: 'VIEW ONLY'; position: absolute; left: 50%; top: 8px; transform: translateX(-50%); background: #7f1d1dee; color: #fff; font-weight: 800; letter-spacing: .14em; font-size: 13px; padding: 5px 14px; border-radius: 0 0 10px 10px; pointer-events: none; z-index: 5; top: 0; }
.navb.locked { opacity: .55; }
.navlock { display: inline-block; width: 10px; height: 11px; margin-right: 5px; border-radius: 2px; background: currentColor; vertical-align: -1px; position: relative; }
.navlock::before { content: ''; position: absolute; left: 1.5px; top: -5px; width: 5px; height: 6px; border: 1.5px solid currentColor; border-bottom: 0; border-radius: 4px 4px 0 0; }
.login { width: 640px; }
.utiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; max-height: 190px; overflow: auto; }
.utile { height: 62px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.utile b { font-size: 16px; } .utile small { font-size: 11px; color: var(--dim); }
.utile.on { border-color: var(--accent); background: var(--sel); }
.credrow { display: flex; gap: 10px; }
.credrow label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--dim); }
.osk { margin-top: 12px; display: flex; flex-direction: column; gap: 5px; }
.osk[hidden] { display: none; }
.oskr { display: flex; gap: 5px; justify-content: center; }
.oskk { flex: 1; max-width: 56px; height: 50px; border-radius: 9px; border: 1px solid var(--line); background: linear-gradient(var(--line2), var(--panel2)); color: var(--text); font-size: 19px; font-weight: 700; cursor: pointer; }
.oskk:active { background: #2e4d6b; }
.oskk.wide { max-width: 80px; flex: 1.4; font-size: 17px; }
.oskk.space { max-width: 280px; flex: 5; font-size: 14px; color: var(--dim); }
.cerr { color: #fca5a5; min-height: 20px; margin: 8px 0 0; font-weight: 600; }
.umenu { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.umenu .mb { justify-content: center; gap: 8px; height: 58px; }
.lvl-pill { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 6px; background: var(--btn); color: #fff; }

.lvnames { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.lvnames label { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--dim); }
.lvnames input { width: 100%; }
.badt { color: #fca5a5; } .mono { font-family: Consolas, monospace; }

.pill span, #clock { white-space: nowrap; }
#top .topright { min-width: 0; }
@media (max-width: 1100px) { #connpill span:last-child { display: none; } #clock small { display: none; } .poweredby small { display: none; } }

/* ---------- troubleshooter */
.w-why { width: 22px; height: 22px; border-radius: 50%; border: 0; background: #9f1239; color: #fff; font-weight: 800; font-size: 13px; cursor: pointer; flex: none; }
.ts { width: 100%; height: 100%; display: grid; grid-template-columns: 250px 1fr 330px; gap: 8px; }
.ts > div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.ts-h { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); padding: 10px 12px 6px; }
.ts-q { margin: 0 10px 8px; height: 40px; border-radius: 9px; border: 1px solid var(--line); background: var(--input); color: var(--text); padding: 0 10px; font-family: inherit; font-size: 14px; }
.ts-conns { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 6px 6px; }
.ts-conn { border: 1px solid var(--line); background: var(--sunk); color: var(--dim); border-radius: 8px; padding: 5px 9px; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.ts-conn.on { color: var(--text); border-color: var(--accent); background: var(--sel); }
.ts-list { flex: 1; overflow: auto; padding: 0 6px 6px; display: flex; flex-direction: column; gap: 4px; }
.ts-item { text-align: left; border: 1px solid transparent; background: var(--sunk); color: var(--text); border-radius: 9px; padding: 7px 9px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.ts-item.on { border-color: var(--accent); background: var(--sel); }
.ts-item b { font-size: 12.5px; } .ts-item span { font-size: 11.5px; color: var(--dim); } .ts-item i { font-size: 10px; color: var(--dim); font-style: normal; }
.ts-plcs { border-top: 1px solid var(--line); padding: 8px 10px; font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.ts-top { display: flex; align-items: center; gap: 10px; padding: 10px; border-bottom: 1px solid var(--line); }
.ts-target { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; }
.ts-target b { font-size: 16px; } .ts-target .dim { overflow: hidden; text-overflow: ellipsis; }
.ts-plc { font-size: 11px; font-weight: 800; background: var(--btn); color: #fff; border-radius: 6px; padding: 2px 7px; flex: none; }
.ts-why { height: 46px; padding: 0 16px; border-radius: 11px; border: 0; background: linear-gradient(#be123c, #9f1239); color: #fff; font-weight: 800; font-size: 15px; cursor: pointer; letter-spacing: .03em; }
.ts-mini { height: 46px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-weight: 700; cursor: pointer; }
.ts-trace { flex: 1; overflow: auto; padding: 10px; }
.ts-empty { padding: 30px; color: var(--dim); max-width: 520px; } .ts-empty b { color: var(--text); font-size: 18px; }
.ts-meta { font-size: 11.5px; color: var(--dim); margin-bottom: 8px; }
.ts-node { margin-left: calc(var(--d) * 18px); border-left: 3px solid var(--btn); padding: 6px 0 6px 10px; margin-bottom: 6px; }
.ts-node .ts-node { border-left-color: #7f1d1d; }
.ts-nh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ts-nh b { font-size: 15px; }
.ts-val { font-weight: 800; font-size: 12px; padding: 2px 8px; border-radius: 6px; } .ts-val.on { background: #14532d; color: #bbf7d0; } .ts-val.off { background: #3f1d1d; color: #fecaca; } .ts-val.unk { background: #2e1065; color: #ddd6fe; }
.ts-via { font-size: 11px; color: var(--dim); }
.ts-desc { font-size: 12.5px; color: var(--dim); margin: 2px 0 4px; }
.ts-note { font-size: 12.5px; color: #93c5fd; margin: 3px 0; } .ts-note.warn { color: #fde68a; }
.ts-w { background: #0b131b; border: 1px solid var(--line2); border-radius: 10px; padding: 8px; margin: 6px 0; }
.ts-wh { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--dim); flex-wrap: wrap; }
.ts-st { font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 5px; } .ts-st.on { background: #14532d; color: #bbf7d0; } .ts-st.off { background: #7f1d1d; color: #fff; } .ts-st.unk { background: #2e1065; color: #ddd6fe; }
.ts-cmt { font-size: 12px; color: #a7f3d0; margin: 4px 0; font-style: italic; }
.ts-ladwrap { overflow-x: auto; padding: 4px 0; } .ts-lad { display: block; }
.ts-stc { background: var(--input); border-radius: 8px; padding: 8px; font-size: 12px; overflow: auto; margin: 4px 0; color: #e2e8f0; }
.ts-stbox { background: var(--input); border-radius: 8px; padding: 6px 0; margin: 4px 0; overflow: auto; font: 12px/1.5 ui-monospace, Consolas, monospace; }
.st-row { width: max-content; min-width: 100%; box-sizing: border-box; display: flex; align-items: center; gap: 8px; padding: 1px 10px 1px 0; border-left: 4px solid transparent; white-space: pre; }
.st-row code { color: var(--text); font: inherit; }
.st-n { color: var(--dim); min-width: 34px; text-align: right; user-select: none; }
.st-row.ok { border-left-color: #22c55e; background: #22c55e14; }
.st-row.bad { border-left-color: #ef4444; background: #ef444422; }
.st-row.unk { border-left-color: #a78bfa; background: #a78bfa14; }
.st-row.st-w { font-weight: 700; } .st-row.st-w.run { background: #22c55e22; } .st-row.st-w.norun { background: #47556933; }
.st-gap { color: var(--dim); }
.st-chip { font: 700 10.5px system-ui, sans-serif; border-radius: 10px; padding: 1px 8px; white-space: nowrap; background: var(--sunk); color: var(--dim); }
.st-chip.ok { background: #16a34a; color: #fff; } .st-chip.bad { background: #dc2626; color: #fff; } .st-chip.unk { background: #7c3aed; color: #fff; } .st-chip.off { background: #475569; color: #fff; }
.sfc { margin: 4px 0; }
.sfc-step { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.sfc-box { border: 2.5px solid #475569; border-radius: 4px; padding: 3px 12px; font-weight: 800; font-family: ui-monospace, Consolas, monospace; }
.sfc-step.on .sfc-box { border-color: #22c55e; box-shadow: inset 0 0 0 3px #22c55e44; }
.sfc-h { font-size: 11.5px; margin: 4px 0 2px; }
.sfc-tr { display: flex; align-items: center; gap: 8px; padding: 3px 8px; border-radius: 6px; font-size: 12px; }
.sfc-tr code { font-family: ui-monospace, Consolas, monospace; }
.sfc-bar { width: 18px; height: 4px; border-radius: 2px; background: #a78bfa; } .sfc-tr.ok .sfc-bar { background: #22c55e; } .sfc-tr.bad .sfc-bar { background: #ef4444; } .sfc-tr.bad { background: #ef444418; }
.ts-fbd { display: block; }
.ts-vals { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11.5px; } .ts-vals span { background: var(--sunk); border-radius: 6px; padding: 2px 6px; } .ts-vals i { color: var(--dim); font-style: normal; }
.ts-block { font-size: 12.5px; color: #fca5a5; margin-top: 4px; } .ts-block i { color: var(--dim); }
.ts-chat { flex: 1; overflow: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.ts-msg { border-radius: 12px; padding: 8px 10px; line-height: 1.4; } .ts-msg.me { background: var(--sel); align-self: flex-end; max-width: 90%; } .ts-msg.ai { background: var(--sunk); border: 1px solid var(--line2); }
.ts-msg p { margin: 4px 0; } .ts-msg ul, .ts-msg ol { margin: 4px 0; padding-left: 20px; } .ts-msg h4 { margin: 8px 0 2px; font-size: 13px; color: var(--accent); } .ts-msg code { background: var(--input); padding: 1px 4px; border-radius: 4px; font-size: 12px; }
.ts-steps { font-size: 12px; color: var(--dim); } .ts-steps div::before { content: '› '; color: var(--accent); }
.ts-stepd { font-size: 11.5px; color: var(--dim); margin-bottom: 4px; } .ts-stepd summary { cursor: pointer; }
.jn-msg .fb-b, .jn-msg .jn-mini { border-color: transparent; background: transparent; color: var(--dim); } .jn-msg .fb-b:hover, .jn-msg .jn-mini:hover { border-color: var(--line); color: var(--text); }
.ts-ask { border-top: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.ts-quick { display: flex; gap: 4px; flex-wrap: wrap; } .ts-quick button { flex: 1; height: 40px; border-radius: 9px; border: 1px solid #9f1239; background: #2a1116; color: #fecdd3; font-weight: 700; cursor: pointer; font-size: 12px; }
.ts-quick button:first-child { background: #9f1239; color: #fff; }
.ts-row { display: flex; gap: 6px; } .ts-in { flex: 1; height: 42px; border-radius: 9px; border: 1px solid var(--line); background: var(--input); color: var(--text); padding: 0 10px; font-family: inherit; font-size: 14px; }
.ts-send { height: 42px; padding: 0 14px; border-radius: 9px; border: 0; background: var(--btn); color: #fff; font-weight: 800; cursor: pointer; }

.aibox { background: var(--sunk); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.learnprog { margin: 8px 0; }

/* ---------------------------------------------------------------- login page (co-branded) */
body.gated #app { visibility: hidden; }
#gate { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px;
  background: radial-gradient(ellipse at 20% 10%, #1b2a3a 0%, var(--input) 55%, var(--bg) 100%); transition: opacity .3s; user-select: none; overflow: auto; }
#gate.out { opacity: 0; pointer-events: none; }
.g-bg { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(6, 1fr); align-content: space-around; justify-items: center; opacity: .045; pointer-events: none; overflow: hidden; }
.g-bg svg { width: 140px; height: 140px; transform: rotate(-12deg); }
.g-card { position: relative; display: grid; grid-template-columns: minmax(280px, 400px) minmax(360px, 560px); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 40px 120px #000c, inset 0 1px 0 #ffffff0d; overflow: hidden; max-width: 100%; }
.g-brand { padding: 30px 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px;
  background: linear-gradient(160deg, #f4f1e8 0%, #e7e0cf 100%); color: #2b2116; }
.g-logo { width: 190px; max-height: 210px; object-fit: contain; display: flex; align-items: center; justify-content: center; }
.g-brand h1 { margin: 10px 0 0; font-size: 28px; letter-spacing: .02em; }
.g-brand p { margin: 0; color: #6b5a44; font-size: 15px; }
.g-x { display: flex; align-items: center; gap: 10px; width: 80%; margin: 18px 0 6px; } .g-x span { flex: 1; height: 1px; background: #b9ab8f; }
.g-x i { font-style: normal; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: #8a7657; font-weight: 800; }
.g-acs { width: 170px; background: var(--stage-bg); border-radius: 12px; padding: 10px 14px; box-shadow: 0 6px 18px #0003; }
.g-brand .g-tag { font-size: 12px; color: #7d6a4f; margin-top: 6px; }
.g-form { padding: 26px 28px 24px; display: flex; flex-direction: column; min-width: 0; }
.g-form h2 { margin: 0; font-size: 26px; letter-spacing: .03em; } .g-form > p.dim { margin: 4px 0 14px; font-size: 13.5px; }
.g-form .utiles { max-height: 150px; }
.g-form .osk { margin-top: 10px; }
.g-go { margin-top: 12px; height: 60px; border: 0; border-radius: 14px; background: linear-gradient(180deg, #2b8ee0, var(--btn)); color: #fff; font-size: 20px; font-weight: 800; letter-spacing: .06em; cursor: pointer; box-shadow: 0 8px 24px #1d6fb855; }
.g-go:active { transform: translateY(1px); }
.g-foot { position: relative; display: flex; gap: 18px; font-size: 13px; color: var(--dim); }
@media (max-width: 900px) { .g-card { grid-template-columns: 1fr; } .g-brand { padding: 18px; } .g-logo { width: 120px; } }

/* ---------------------------------------------------------------- Ask Johnny the Ginner */
.jnbtn { display: flex; align-items: center; gap: 7px; height: 48px; padding: 0 12px 0 6px; border-radius: 24px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-weight: 800; font-size: 12px; line-height: 1.05; text-align: left; cursor: pointer; flex: none; }
.jnbtn .jn-av { width: 36px; height: 36px; }
.jn-av { width: 34px; height: 34px; flex: none; border-radius: 50%; object-fit: cover; }
.jn { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--panel); }
.jn-h { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; flex-wrap: wrap; background: var(--header); border-bottom: 1px solid var(--line2); touch-action: none; }
.jn.floating .jn-h { cursor: grab; } #jnwin.dragging .jn-h { cursor: grabbing; }
.jn-t { flex: 1 1 150px; display: flex; flex-direction: column; min-width: 0; }
/* the tool buttons: beside the name when there is room, under it (right-aligned) when there is not */
.jn-hb { display: flex; gap: 2px; flex-basis: 100%; justify-content: flex-end; } .jn-t b { color: var(--text); font-size: 15px; font-weight: 700; line-height: 1.15; } .jn-t small { color: var(--dim); font-size: 11.5px; }
.jn-b { width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--dim); display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; } .jn-b:hover { background: var(--panel2); color: var(--text); } .jn-b:active { background: var(--sel); }
.jn-fo { display: none; } .jn.floating .jn-fo { display: flex; } .jn.inslot .jn-cl { display: none; }
.jn-ctx { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 14px; font-size: 12px; border-bottom: 1px solid var(--line2); background: transparent; min-height: 32px; }
.jn-ctx > span:first-child { color: var(--dim); text-transform: uppercase; letter-spacing: .1em; font-size: 10.5px; font-weight: 800; }
.jn-ctx i { color: var(--dim); font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.jn-ctx i { flex-basis: 100%; order: 5; } .jn-cx { margin-left: auto; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--dim); cursor: pointer; }
.jn-chat { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; font-size: 14px; user-select: text; }
.jn-msg { border-radius: 14px; padding: 9px 13px; line-height: 1.5; }
.jn-msg.me { background: var(--btn); color: #fff; align-self: flex-end; max-width: 85%; border-bottom-right-radius: 4px; }
.jn-msg.ai { background: transparent; border: 0; padding: 0; display: flex; gap: 10px; align-items: flex-start; } .jn-msg.ai > div { flex: 1; min-width: 0; }
.jn-msg.ai .jn-av { width: 26px; height: 26px; margin-top: 2px; }
.jn-msg p { margin: 4px 0; } .jn-msg ul, .jn-msg ol { margin: 4px 0; padding-left: 20px; } .jn-msg li { margin: 2px 0; } .jn-msg h4 { margin: 10px 0 2px; font-size: 13.5px; color: var(--text); } .jn-msg code { background: var(--sunk); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; } .jn-msg a { color: var(--accent); }
.jn-ask { border-top: 1px solid var(--line2); padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.jn-quick { display: flex; gap: 6px; flex-wrap: wrap; } .jn-quick button { flex: none; min-height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line); background: transparent; color: var(--text2); font-weight: 600; font-size: 12.5px; cursor: pointer; } .jn-quick button:hover { border-color: var(--accent); color: var(--text); }
.jn-quick button:active { background: var(--sel); }
.jn-row { display: flex; gap: 6px; align-items: flex-end; background: var(--input); border: 1px solid var(--line); border-radius: 14px; padding: 5px 5px 5px 12px; } .jn-row:focus-within { border-color: var(--accent); } .jn-in { flex: 1; min-width: 0; min-height: 44px; max-height: 170px; resize: none; line-height: 20px; border: 0; border-radius: 0; background: transparent; color: var(--text); padding: 7px 0; font-family: inherit; font-size: 15px; overflow-y: hidden; outline: none; }
.jn-send { width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-text); font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center; flex: none; } .jn-send:active { filter: brightness(1.15); }
.jn-away .jn-send, .jn-send.jn-wide { width: auto; height: 40px; padding: 0 18px; border-radius: 10px; }
.jn-osk .oskk { height: 38px; }
.osk-inline { margin: 8px 0 6px; padding: 4px 0; user-select: none; -webkit-user-select: none; } .osk-inline .oskk { height: 44px; font-size: 17px; }
.jn-away { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--dim); text-align: center; padding: 16px; }
.jn-away .jn-av { width: 64px; height: 64px; opacity: .8; }
#jnwin { position: fixed; z-index: 90; display: none; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 24px 70px #000d, 0 0 0 1px #0006; background: var(--panel); }
#jnwin.show { display: flex; flex-direction: column; } #jnwin > .jn { flex: 1; }
.jn-rz { position: absolute; right: 0; bottom: 0; width: 28px; height: 28px; cursor: nwse-resize; touch-action: none; z-index: 2;
  background: linear-gradient(135deg, transparent 50%, #a1620799 50%, #a1620799 60%, transparent 60%, transparent 70%, #a1620799 70%, #a1620799 80%, transparent 80%); }
#jnbubble { position: fixed; z-index: 90; display: none; align-items: center; gap: 6px; height: 60px; padding: 0 16px 0 8px; border-radius: 30px; border: 2px solid var(--accent); background: var(--panel2); color: var(--text); font-weight: 800; font-size: 15px; box-shadow: 0 12px 34px #000b; cursor: pointer; touch-action: none; }
#jnbubble.show { display: flex; } #jnbubble .jn-av { width: 44px; height: 44px; }
.ts > .jn-slot { padding: 0; }

/* ---------------------------------------------------------------- users & permission sets */
.utabs { display: flex; gap: 6px; margin: 0 0 12px; } .utabs button { height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--dim); font-weight: 800; cursor: pointer; }
.utabs button.on { background: var(--sel); border-color: var(--accent); color: var(--text); }
.ovn { display: inline-flex; min-width: 18px; height: 18px; border-radius: 9px; background: #f59e0b; color: #1a1206; font-size: 11px; align-items: center; justify-content: center; margin-left: 4px; }
.ovrow td { background: var(--sunk); }
.ovgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 6px; padding: 6px 0; }
.ovitem { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 6px 8px; border-radius: 9px; border: 1px solid var(--line); border-left: 4px solid var(--off); }
.ovitem.yes { border-left-color: var(--run); } .ovitem small { display: block; color: var(--dim); font-size: 11px; }
.seg { display: flex; flex: none; } .seg button { height: 34px; padding: 0 9px; border: 1px solid var(--line); background: var(--input); color: var(--dim); font-size: 12px; font-weight: 700; cursor: pointer; }
.seg button:first-child { border-radius: 8px 0 0 8px; } .seg button:last-child { border-radius: 0 8px 8px 0; } .seg button.on { background: var(--btn); color: #fff; border-color: var(--accent); }
.pmx th input { width: 128px; font-size: 13px !important; height: 36px !important; font-weight: 700; text-align: center; } .pmx th small { display: block; color: var(--dim); font-weight: 400; font-size: 10.5px; text-align: center; }
.pmx td small { display: block; color: var(--dim); font-size: 11px; } .pmx td:not(:first-child) { text-align: center; }
button.pchk { width: 44px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--input); color: #fff; font-size: 20px; font-weight: 900; cursor: pointer; }
button.pchk.on { background: #166534; border-color: #22c55e; }
.w-tspan button.locked { opacity: .45; }

/* ---------------------------------------------------------------- recovery key */
.rkey { white-space: nowrap; font-size: 23px; font-weight: 800; letter-spacing: .08em; text-align: center; padding: 16px 10px; margin: 10px 0; border-radius: 12px; background: var(--input); border: 2px dashed #f59e0b; color: #fde68a; user-select: all; }
.rkl { margin: 6px 0 12px; padding-left: 20px; color: var(--dim); font-size: 14px; } .rkl li { margin: 3px 0; }
.rkack { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 10px 0; } .rkack input { width: 24px; height: 24px; }
.g-forgot { margin-top: 10px; align-self: center; background: none; border: 0; color: var(--accent); font-size: 15px; font-weight: 700; cursor: pointer; padding: 8px 12px; }
.rkbox { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid #5a4327; background: #1d150d; }
.mb:disabled { opacity: .4; cursor: not-allowed; }

/* nav labels that don't fit */
.navb { overflow: hidden; overflow-wrap: anywhere; }
.navb.long { font-size: 12.5px; letter-spacing: .02em; }
.navb.xlong { font-size: 11px; letter-spacing: 0; }
/* Johnny docked at the side of any screen - the screen scales down to make room */
#jndock { display: none; position: relative; width: var(--jnw, 380px); flex: none; border-left: 1px solid var(--line2); background: var(--panel); min-height: 0; }
body.jn-docked #jndock { display: flex; flex-direction: column; }
#jndock > .jn { flex: 1; }
.jnd-grip { position: absolute; left: -7px; top: 0; bottom: 0; width: 14px; cursor: ew-resize; z-index: 3; touch-action: none; }
.jnd-grip::after { content: ''; position: absolute; left: 5px; top: 50%; width: 4px; height: 56px; margin-top: -28px; border-radius: 2px; background: var(--accent); opacity: .5; }
body.editmode #jndock { display: none; }
.jnbtn.on { background: var(--btn); border-color: var(--accent); color: #fff; }

/* ---------------------------------------------------------------- theme hooks */
.w-num, .w-mcard-b b, .w-mcard b, .w-vcard b, .w-aval b, .ts-val, .wb-v, #clock, .w-field { font-family: var(--font-num); }
#top, #nav, .modal, #jndock, #jnwin, #jnbubble, #wbar, #toasts { zoom: var(--ui-zoom); }

/* ---------------------------------------------------------------- theme dialog */
.thscope { display: flex; gap: 8px; margin-bottom: 10px; } .thscope button { flex: 1; min-height: 56px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-weight: 800; font-size: 15px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.thscope button small { font-weight: 500; font-size: 11.5px; color: var(--dim); } .thscope button.on { background: var(--sel); border-color: var(--accent); }
.thallow { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-weight: 600; } .thallow input { width: 22px; height: 22px; }
.thgrid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 18px; } .thgrid h4 { margin: 12px 0 6px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.thgrid select { width: 100%; }
.thpresets { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.thp { text-align: left; padding: 6px 6px 8px; border-radius: 12px; border: 2px solid var(--line2); background: var(--panel2); color: var(--text); cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.thp.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); } .thp b { font-size: 14px; padding: 0 4px; } .thp small { font-size: 11px; color: var(--dim); padding: 0 4px; line-height: 1.25; }
.thsw { height: 70px; border-radius: 8px; padding: 6px; margin-bottom: 4px; } .thsw > div { position: relative; height: 100%; border-radius: 6px; border: 1px solid; display: flex; align-items: center; gap: 8px; padding: 0 8px; }
.thsw i { display: flex; gap: 4px; padding: 6px; border-radius: 5px; border: 1px solid; } .thsw i b { width: 12px; height: 22px; border-radius: 3px; padding: 0; }
.thsw span { font-weight: 800; font-size: 15px; } .thsw em { position: absolute; right: 6px; top: 6px; width: 22px; height: 8px; border-radius: 4px; }
.thfine { margin-top: 10px; } .thfine summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.thcolors { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; margin: 6px 0 8px; }
.thcolors label { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px; border-radius: 8px; } .thcolors label.chg { background: var(--sel); }
.thcolors input[type=color] { width: 44px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
.thsize button { flex: 1; }
.thprev { margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--stage-bg); border: 1px solid var(--line); } .thprev-h { font-size: 11px; letter-spacing: .12em; color: var(--dim); font-weight: 800; }
.thprev p { margin: 6px 0; } .thprev-n { font-family: var(--font-num); font-weight: 800; font-size: 18px; color: var(--accent); }
.ts-val.bad { background: var(--fault); color: #fff; }
@media (max-width: 900px) { .thgrid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- watch bar */
#wbar { display: none; flex: none; background: var(--nav); border-top: 1px solid var(--line2); padding: 6px 8px; gap: 8px; align-items: stretch; }
body.wb-open #wbar { display: flex; }
.wb-h { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex: none; }
.wb-h > span { font-size: 10px; font-weight: 800; letter-spacing: .16em; color: var(--dim); }
.wb-add { height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--accent); background: var(--sel); color: var(--text); font-weight: 800; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.wb-x { height: 26px; width: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--dim); cursor: pointer; font-size: 14px; }
.wb-list { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
.wb-c { flex: none; min-width: 128px; max-width: 220px; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 5px 10px; border-radius: 10px; border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--panel); color: var(--text); cursor: pointer; text-align: left; }
.wb-n { font-size: 11.5px; font-weight: 700; color: var(--text2); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-v { font-size: 22px; font-weight: 800; line-height: 1.1; white-space: nowrap; } .wb-v small { font-size: 11px; font-weight: 700; color: var(--dim); margin-left: 3px; }
.wb-d { font-size: 10.5px; color: var(--dim); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-c.on { border-left-color: var(--run); } .wb-c.on .wb-v { color: var(--run); }
.wb-c.off { border-left-color: var(--off); } .wb-c.off .wb-v { color: var(--dim); }
.wb-c.na { border-left-color: var(--line); } .wb-c.na .wb-v { color: var(--dim); }
.wb-empty { margin: auto 8px; color: var(--dim); font-size: 14px; }
.wbbtn { display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--dim); cursor: pointer; flex: none; font-weight: 800; font-size: 13px; }
.wbbtn.on { border-color: var(--accent); color: var(--text); background: var(--sel); }
.wbbtn b { font-size: 11px; min-width: 16px; height: 16px; line-height: 16px; border-radius: 8px; background: var(--accent); color: var(--accent-text); padding: 0 4px; } .wbbtn b:empty { display: none; }
body.editmode #wbar { display: none; }
@media (max-width: 1450px) { .wbbtn span { display: none; } }
/* Johnny's watch */
.jnbtn { position: relative; } .jn-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; background: var(--fault, #dc2626); color: #fff; font-size: 11px; font-weight: 800; padding: 0 5px; font-style: normal; }
.wt-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; } @media (max-width: 900px) { .wt-cols { grid-template-columns: 1fr; } }
.wt-card { border: 1px solid var(--line); border-left: 5px solid var(--dim); border-radius: 12px; padding: 10px 12px; margin: 8px 0; background: var(--panel2); } .wt-card p { margin: 6px 0; }
.wt-card.sev-high { border-left-color: #dc2626; } .wt-card.sev-mid { border-left-color: #f59e0b; } .wt-card.sev-low { border-left-color: #3b82f6; } .wt-card.sev-note { border-left-color: #2563eb; }
.wt-ch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .wt-sev { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.wt-acts { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; } .mb.sm { height: 36px; padding: 0 12px; font-size: 13px; }
.wt-new { display: flex; gap: 6px; margin: 6px 0 10px; } .wt-in { flex: 1; min-width: 0; }
.wt-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); } .wt-row.off > div { opacity: .55; } .wt-row > div { flex: 1; min-width: 0; } .wt-tog input { width: 22px; height: 22px; }
.wt-ev { padding: 6px 0; border-top: 1px solid var(--line); }
.jn-watchmsg { border-left: 3px solid var(--accent); padding-left: 10px; }
.editmode #histbtn { display: none !important; }
@media (min-width: 1000px) { #histbtn span { display: inline; } } /* keeps its word when the other top-bar buttons drop theirs */

/* light themes: a few details that assume a dark background */
[data-theme-kind="light"] .pill.warn { color: #7c4a03; background: #fff3d6; }
[data-theme-kind="light"] .w-tspan button:not(.on) { color: var(--text2); }

/* customer branding */
.w-logoplate.dark { background: #0b1117; } .w-logoplate.none { background: none; box-shadow: none; padding: 0; }
.g-logo.dark { background: #0b1117; border-radius: 12px; padding: 10px; } 
.brandbox { display: flex; gap: 12px; align-items: flex-start; }
.brandprev { width: 150px; height: 110px; border-radius: 12px; display: flex; align-items: center; justify-content: center; padding: 8px; border: 1px solid var(--line); flex: none; background: var(--cotton); }
.brandprev.dark { background: #0b1117; } .brandprev.none { background: repeating-conic-gradient(var(--panel2) 0 25%, var(--panel) 0 50%) 0 0 / 16px 16px; }
.brandprev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brandctl { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; } .brandctl select { width: 100%; }

/* power button + menu */
.pwrbtn { width: 48px; height: 48px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--dim); display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.pwrbtn:active { color: var(--fault); }
body.gated .pwrbtn { display: none; }
.pwlist { display: flex; flex-direction: column; gap: 6px; }
.pwi { text-align: left; min-height: 58px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.pwi b { font-size: 16px; } .pwi small { font-size: 12px; color: var(--dim); }
.pwi.warn { border-left: 5px solid var(--warn); } .pwi.bad { border-left: 5px solid var(--fault); }
.closedpg { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: var(--bg); color: var(--text); text-align: center; padding: 20px; }
.closedpg b { font-size: 24px; } .closedpg p { color: var(--dim); } .closedpg button { height: 50px; padding: 0 20px; border-radius: 12px; border: 0; background: var(--btn); color: #fff; font-weight: 800; font-size: 16px; }

/* ---------------------------------------------------------------- phone view */
#ph, #phtabs, #phback { display: none; }
body.phone #nav, body.phone #wbar, body.phone #jndock, body.phone #jnwin, body.phone #jnbubble, body.phone #etool { display: none !important; }
body.phone #top { height: 56px; gap: 8px; padding: 0 8px; padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
body.phone #top .topright > :not(#almpill) { display: none !important; }
body.phone #almpill span { display: none; } body.phone #almpill { padding: 0 10px; }
body.phone #brand > div { display: none; } body.phone #brand .logoplate { height: 40px; } body.phone #brand .logoplate img { height: 34px; }
body.phone #scrname { font-size: 17px; text-align: left; }
body.phone #phback { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); align-items: center; justify-content: center; flex: none; }
body.phone[data-ptab="screen"] #phback { display: flex; } body.phone[data-ptab="screen"] #brand { display: none; }
body.phone:not([data-ptab="screen"]) #work { display: none; }
body.phone[data-ptab="screen"] #ph { display: none; }
body.phone #viewport { overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
body.phone #viewport::after { display: none; }
body.phone #pzsizer { pointer-events: none; }
body.phone #ph { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; }
body.phone #phtabs { display: grid; grid-template-columns: repeat(5, 1fr); flex: none; background: var(--nav); border-top: 1px solid var(--line2); padding-bottom: env(safe-area-inset-bottom); }
#phtabs button { position: relative; height: 60px; border: 0; background: none; color: var(--dim); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; font-family: inherit; }
#phtabs button svg { width: 24px; height: 24px; } #phtabs button.on { color: var(--accent); }
#phtabs .phb { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--fault); color: #fff; font-size: 11px; line-height: 18px; padding: 0 5px; } #phtabs .phb:empty { display: none; }
.ph-list { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.ph-scr { display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); border-left: 6px solid var(--c); background: var(--panel); color: var(--text); font-size: 17px; font-family: inherit; text-align: left; }
.ph-scr span { color: var(--dim); font-size: 22px; } .ph-scr.locked { opacity: .55; } .ph-scr.locked span { font-size: 12px; }
.ph-alm { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); border-left: 6px solid var(--warn); background: var(--panel); }
.ph-alm.act { border-left-color: var(--fault); } .ph-alm.unack.act { background: #3b1113; color: #fff; }
.ph-alm > div { flex: 1; min-width: 0; } .ph-alm b { display: block; font-size: 15px; } .ph-alm small { color: var(--dim); font-size: 12px; } .ph-alm.unack.act small { color: #fecaca; }
.ph-alm button { height: 44px; padding: 0 14px; border-radius: 10px; border: 0; background: var(--btn); color: #fff; font-weight: 800; } .ph-alm i { color: var(--dim); font-size: 12px; }
.ph-w { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); border-left: 6px solid var(--accent); background: var(--panel); color: var(--text); font-family: inherit; text-align: left; }
.ph-w span { flex: 1; min-width: 0; } .ph-w b { display: block; font-size: 15px; } .ph-w small { display: block; font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-w em { font-style: normal; font-family: var(--font-num); font-size: 26px; font-weight: 800; white-space: nowrap; } .ph-w em small { display: inline; font-size: 12px; }
.ph-w.on { border-left-color: var(--run); } .ph-w.on em { color: var(--run); } .ph-w.off { border-left-color: var(--off); } .ph-w.off em { color: var(--dim); }
.ph-wide, .ph-row { min-height: 54px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 16px; font-weight: 700; font-family: inherit; }
.ph-wide { border-color: var(--accent); background: var(--sel); } .ph-row { text-align: left; padding: 0 16px; }
.ph-me { padding: 8px 4px; } .ph-me b { display: block; font-size: 20px; } .ph-me small { color: var(--dim); }
.ph-empty { color: var(--dim); text-align: center; padding: 20px 10px; }
.ph-jn { flex: 1; display: flex; min-height: 0; } .ph-jn > .jn { flex: 1; }
body.phone .modal { max-width: 100vw; } body.phone .modal.wide, body.phone .modal.small { width: 100vw; }
body.phone .modal-back { align-items: flex-end; } body.phone .modal { border-radius: 18px 18px 0 0; max-height: 94vh; max-height: 94dvh; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
body.phone #gate .g-card { grid-template-columns: 1fr; } body.phone #gate .g-brand { padding: 14px; } body.phone #gate .g-logo { width: 110px; } body.phone #gate .g-brand h1 { font-size: 20px; } body.phone #gate .g-x, body.phone #gate .g-acs, body.phone #gate .g-tag { display: none; }
@media (max-width: 600px) {
  #gate { justify-content: flex-start; padding: 10px; } #gate .g-card { grid-template-columns: 1fr; } #gate .g-brand { padding: 14px; flex-direction: row; gap: 12px; text-align: left; }
  #gate .g-logo { width: 72px; } #gate .g-brand h1 { font-size: 19px; margin: 0; } #gate .g-x, #gate .g-acs, #gate .g-tag { display: none; }
  #gate .g-form { padding: 16px; } .osk { display: none; } .g-foot { flex-wrap: wrap; justify-content: center; }
}
#phzoom { display: none; } body.phone[data-ptab="screen"] #phzoom { display: flex; position: fixed; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 20; gap: 0; border-radius: 12px; overflow: hidden; box-shadow: 0 6px 20px #0008; border: 1px solid var(--line); }
#phzoom button { width: 52px; height: 46px; border: 0; background: var(--panel2); color: var(--text); font-size: 22px; font-weight: 800; font-family: inherit; } #phzoom button[data-z="0"] { font-size: 13px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
#work { position: relative; }

/* phones & tablets: View Only badge */
body.mobilero #scrname::after { content: 'VIEW ONLY'; margin-left: 10px; font-size: 11px; letter-spacing: .12em; padding: 3px 8px; border-radius: 6px; background: #7f1d1d; color: #fff; vertical-align: middle; }
body.phone.mobilero #scrname::after { font-size: 9.5px; padding: 2px 6px; margin-left: 6px; }
@media (max-width: 1180px) { .jnbtn span, .editbtn span { display: none; } .jnbtn { padding: 0 6px; } .editbtn { padding: 0 12px; } #top { gap: 8px; } .userbtn span { max-width: 84px; } }
@media (max-width: 1000px) { #connpill { display: none; } .poweredby { display: none; } }

/* screen title: may use two lines before it gets small */
#scrname.two { white-space: normal; text-overflow: clip; line-height: 1.05; max-height: 2.2em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: normal; overflow-wrap: normal; }
#scrname { align-self: center; }
@media (max-width: 1450px) { #connpill span:last-child { display: none; } #connpill { padding: 0 12px; } }

/* ---------------------------------------------------------------- phone: stacked screens */
body.stacked #stage { position: relative; transform: none !important; width: auto !important; height: auto !important; min-height: 100%; display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 8px; padding: 8px 8px 90px; overflow: visible; }
body.stacked #viewport { overflow-x: hidden; }
.stk { position: relative; flex: none; }
.stk > .wd { position: absolute; }
.stk.auto { height: auto; } .stk.auto > .wd { position: relative; height: auto !important; min-height: 100px; }
body.phone .w-board-row { flex-wrap: wrap; } body.phone .w-board-c { flex: 1 1 150px; } body.phone .w-bales-b { overflow: auto; max-height: 70vh; }
.stk-head { flex: 0 0 100%; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); padding: 8px 4px 0; }
#phzoom .phz { display: flex; } body.stacked #phzoom .phz { display: none; }
#phzoom .phlay { width: auto !important; padding: 0 14px; font-size: 13px !important; border-right: 1px solid var(--line) !important; }
.g-locked { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: #3b1113; border: 1px solid var(--fault); color: #fecaca; font-size: 14px; }

/* ---- license */
.licgate { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(1200px 700px at 30% 20%, #17325a, #0a1422 70%); overflow: auto; }
.lic-card { width: min(640px, 100%); background: var(--panel, #111c28); color: var(--text, #e3ebf3); border: 1px solid #ffffff22; border-radius: 16px; padding: 24px 26px; box-shadow: 0 30px 80px #0008; }
.lic-card.small { width: min(460px, 100%); }
.lic-card h2 { margin: 0 0 6px; font-size: 24px; } .lic-card p { margin: 6px 0; }
.lic-top { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; } .lic-top img { height: 54px; }
.lic-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 12px 0; font-size: 14px; } .lic-facts b { color: var(--dim, #8aa0b6); font-weight: 600; }
.lic-l { display: block; font-size: 13px; color: var(--dim, #8aa0b6); margin: 12px 0 4px; font-weight: 700; }
.lic-key { width: 100%; font-family: ui-monospace, Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; }
.lic-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.lic-code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: #0008; border: 1px solid #ffffff22; border-radius: 8px; padding: 10px 12px; word-break: break-all; user-select: all; max-height: 150px; overflow: auto; }
.lic-in { width: 100%; min-height: 90px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--input, #0b1219); color: inherit; border: 1px solid #ffffff33; border-radius: 8px; padding: 8px; }
.lic-off { border-top: 1px solid #ffffff22; margin-top: 10px; padding-top: 6px; } .hide { display: none !important; }
.lic-ok { color: #86efac; font-weight: 700; font-size: 16px; }
.lic-seats { width: 100%; border-collapse: collapse; margin: 6px 0 12px; } .lic-seats td { padding: 6px 4px; border-bottom: 1px solid #ffffff18; } .lic-seats td:last-child { text-align: right; }
.g-lic { background: #b4530933; border: 1px solid #f59e0b88; color: #fde68a; border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.warnt { color: #fbbf24; font-weight: 600; }
body.gated .modal-back { z-index: 300; }
.upd-notes { white-space: pre-wrap; font-size: 12.5px; max-height: 220px; overflow: auto; background: #0005; border-radius: 8px; padding: 8px 10px; }

/* ---- personal screens ("Build my own screens") */
.navsep { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-top: 2px; }
.navsep::before, .navsep::after { content: ''; flex: 1; height: 1px; background: var(--line2); }
.navb.mine { background: color-mix(in srgb, var(--panel2) 70%, var(--c) 30%); }
.navb.mine.on { background: var(--c); }
.navme { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; border: 2px solid currentColor; vertical-align: -1px; opacity: .8; }
.etag { font-size: 11px; font-weight: 800; letter-spacing: .16em; color: #061019; background: #f59e0b; border-radius: 6px; padding: 4px 8px; }
.editmode.personal #etool { background: #1a1409; border-bottom-color: #6b4c12; }
.editmode.personal #lib .libhead b::after { content: ' · my screens'; color: var(--dim); font-weight: 400; }
/* ACS remote support badge: visible on every screen while the customer's switch is on */
.rmbadge { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px; border-radius: 10px; border: 1px solid #ed2c40; background: #1a144a; color: #ed2c40; cursor: pointer; flex: none; font-weight: 800; font-size: 12px; letter-spacing: .1em; animation: rmpulse 2.4s ease-in-out infinite; }
.rmbadge img { height: 20px; display: block; }
@keyframes rmpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(237, 44, 64, .5); } 50% { box-shadow: 0 0 0 6px rgba(237, 44, 64, 0); } }
@media (max-width: 1100px) { .rmbadge span { display: none; } }
.rmon { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; } .rmon .row { display: flex; gap: 8px; align-items: center; }

/* network watch popup: one card to acknowledge, bottom left, above the screen tabs */
body.phone .netpop { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); } body.rail .netpop { left: 80px; }
.netpop { position: fixed; left: 16px; bottom: 16px; z-index: 95; width: min(420px, calc(100vw - 32px)); background: #1e293b; color: #fff; border: 1px solid var(--line); border-left: 6px solid #64748b; border-radius: 12px; padding: 12px 14px; box-shadow: 0 10px 30px #000a; font-size: 15px; }
.netpop.sev-mid { border-left-color: #d9a441; } .netpop.sev-high { border-left-color: #dc2626; }
.netpop .np-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.netpop .np-row { display: flex; gap: 8px; align-items: baseline; margin: 4px 0; }
.netpop .np-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* Johnny's past questions */
.jl-list { max-height: 60vh; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.jl-item { background: var(--sunk); border: 1px solid var(--line2); border-radius: 10px; padding: 8px 12px; }
.jl-item summary { cursor: pointer; display: flex; flex-direction: column; gap: 2px; list-style: none; } .jl-item summary::-webkit-details-marker { display: none; }
.jl-item summary b { font-size: 14px; } .jl-a { margin-top: 8px; font-size: 14px; line-height: 1.45; border-top: 1px solid var(--line2); padding-top: 8px; }
.rmbadge.stuck { background: #7f1d1d; border-color: #ef4444; color: #fff; animation: rmpulse 1s ease-in-out infinite; }

/* copy / share on Johnny's answers */
.jn-acts { display: flex; gap: 6px; margin-top: 8px; } .jn-mini { border: 1px solid var(--line2); background: var(--sunk); color: var(--dim); border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; } .jn-mini:active { background: var(--sel); color: var(--text); }
.jn-sharebox { width: 100%; min-height: 40vh; background: var(--input); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: 13px/1.45 var(--font-ui, inherit); white-space: pre-wrap; }
/* shift log */
.sl-modal { width: min(1100px, 96vw); }
.sl-form { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.sl-row { display: flex; gap: 10px; flex-wrap: wrap; } .sl-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--dim); min-width: 120px; flex: 1; } .sl-row label input, .sl-row label select { height: 40px; } .sl-row .sl-dt { flex: 0 0 auto; } .sl-row label[hidden] { display: none; }
.sl-form textarea { width: 100%; min-height: 90px; resize: vertical; font: inherit; font-size: 15px; padding: 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--sunk); color: var(--text); box-sizing: border-box; }
.sl-ph { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .sl-ph .eb { margin-left: auto; }
.sl-parts td { padding: 3px 4px; border: 0; } .sl-parts input { width: 100%; box-sizing: border-box; }
.sl-filt { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 14px 0 8px; } .sl-filt input[data-q] { flex: 1; min-width: 180px; height: 40px; } .sl-filt select { height: 40px; } .sl-chk { display: flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; }
.sl-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; padding-right: 2px; }
.sl-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; } .sl-card.is-open { border-color: #b45309; }
.sl-ch { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; } .sl-text { margin: 8px 0; font-size: 15px; white-space: normal; line-height: 1.35; } .sl-cf { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sl-badge { font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 2px 8px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); text-transform: uppercase; }
.sl-badge.sl-problem { color: #fca5a5; border-color: #7f1d1d; } .sl-badge.sl-handoff { color: #93c5fd; border-color: #1e3a8a; } .sl-badge.sl-maintenance { color: #86efac; border-color: #14532d; } .sl-badge.sl-parts { color: #fde68a; border-color: #92400e; }
.sl-badge.sl-open { background: #92400e; color: #fff; border-color: #b45309; } .sl-badge.sl-done { background: #14532d; color: #fff; border-color: #166534; }
.sl-pt { border-collapse: collapse; font-size: 13px; margin: 4px 0 8px; } .sl-pt th { text-align: left; color: var(--dim); font-size: 11px; padding: 2px 10px 2px 0; } .sl-pt td { padding: 2px 10px 2px 0; border-top: 1px solid var(--line2); }
@media (max-width: 640px) { .sl-row label { min-width: 45%; } .sl-list { max-height: none; } .sl-modal { padding: 12px; } }
/* spreadsheets attached to Johnny */
.jn-files { display: flex; gap: 6px; flex-wrap: wrap; } .jn-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 6px 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 12.5px; font-weight: 600; } .jn-chip small { color: var(--dim); font-weight: 500; } .jn-chip svg { width: 14px; height: 14px; } .jn-chip button { border: 0; background: transparent; color: var(--dim); cursor: pointer; font-size: 13px; padding: 0 4px; }
.jn.jn-drop { outline: 3px dashed var(--accent); outline-offset: -4px; } .jn.jn-drop .jn-chat::after { content: 'Drop the spreadsheet here for Johnny'; display: block; margin: 12px; padding: 14px; border-radius: 10px; border: 1px dashed var(--accent); color: var(--text); text-align: center; }
/* long screens (Page length > 1): the viewport scrolls down the page */
body.tall #viewport { overflow-y: auto; overflow-x: hidden; touch-action: pan-y; -webkit-overflow-scrolling: touch; } body.tall #pzsizer { pointer-events: none; position: absolute; left: 0; top: 0; }
/* top bar: measured collapse levels (H.fitTop) - each level hides a little more until the bar fits */
#top { overflow: visible; } .topright > * { flex-shrink: 0; }
#top.tb1 .jnbtn span, #top.tb1 .editbtn span, #top.tb1 #histbtn span, #top.tb1 .wbbtn span, #top.tb1 .lockbtn span, #top.tb1 .userbtn small { display: none; }
#top.tb1 .jnbtn { padding: 0 6px; } #top.tb1 .editbtn { padding: 0 12px; } #top.tb1 .pill { padding: 0 10px; font-size: 12px; } #top.tb1 .topright { gap: 6px; } #top.tb1 .userbtn span { max-width: 84px; }
#top.tb2 .poweredby, #top.tb2 #clock small, #top.tb2 #connpill span:last-child, #top.tb2 #brand > div { display: none; }
#top.tb3 .userbtn span, #top.tb3 .pill.ok span, #top.tb3 #rmbadge span, #top.tb3 .acsrm span { display: none; } #top.tb3 .pill.ok { padding: 0 8px; } #top.tb3 .userbtn { padding: 0 8px; }
#top.tb4 #connpill, #top.tb4 #histbtn, #top.tb4 #clock { display: none; }
#top.tb5 #wbbtn, #top.tb5 .lockbtn:not(.on) { display: none; }
body.readonly #top .lockbtn span { display: inline; }
/* report builder */
.rp-warn { margin: 4px 0; padding: 8px 12px; border-radius: 9px; background: #3b2a08; border: 1px solid #92400e; color: #fde68a; font-size: 13.5px; }
.rp-table td { vertical-align: top; } .rp-table tr.rp-off td { opacity: .6; } .rp-act { white-space: nowrap; text-align: right; } .rp-act .eb { margin-left: 6px; } .rp-ok { color: #86efac; font-weight: 700; }
.rp-sent { margin-top: 14px; } .rp-sent summary { cursor: pointer; font-weight: 700; color: var(--dim); }
.modal.rp-wide { width: min(1500px, 97vw); max-height: 94vh; }
.rp-ed { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(360px, 720px); gap: 18px; align-items: start; }
.rp-left { max-height: calc(94vh - 90px); overflow: auto; padding-right: 6px; } .rp-left h4 { margin: 16px 0 6px; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); }
.rp-right { position: sticky; top: 0; } .rp-frame { width: 100%; height: calc(94vh - 160px); min-height: 420px; border: 1px solid var(--line); border-radius: 12px; background: #f3f5f8; }
.rp-subj { margin: 0 0 6px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; } .rp-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--dim); flex: 1; min-width: 130px; }
.rp-f > input:not([type=checkbox]):not([type=color]), .rp-f > select, .rp-f > textarea { height: 38px; font: inherit; font-size: 14px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--sunk); color: var(--text); width: 100%; box-sizing: border-box; }
.rp-f > textarea { height: auto; padding: 8px 10px; resize: vertical; } .rp-f > input[type=color] { width: 60px; height: 38px; padding: 2px; border-radius: 9px; border: 1px solid var(--line); background: var(--sunk); }
.rp-chk { display: flex; align-items: center; gap: 8px; height: 38px; font-size: 14px; color: var(--text); } .rp-chks { display: flex; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--text); min-height: 38px; align-items: center; } .rp-chks label { display: flex; gap: 5px; align-items: center; }
.rp-block { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; } .rp-bh { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; } .rp-bh b { white-space: nowrap; } .rp-bh input { flex: 1; min-width: 120px; height: 36px; }
.rp-items { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 6px; } .rp-items th { text-align: left; font-size: 11px; color: var(--dim); padding: 2px 4px; } .rp-items td { padding: 2px 4px; } .rp-items input, .rp-items select { height: 36px; width: 100%; box-sizing: border-box; font-size: 13.5px; }
.rp-block textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--sunk); color: var(--text); resize: vertical; }
@media (max-width: 1000px) { .rp-ed { grid-template-columns: 1fr; } .rp-right { position: static; } .rp-frame { height: 70vh; } .rp-left { max-height: none; } }
.rp-jbox { margin-top: 10px; padding: 10px 12px; border: 1px solid #2563eb; border-radius: 12px; background: #0f2447; }
.rp-jlog { display: flex; flex-direction: column; gap: 4px; max-height: 120px; overflow: auto; margin-bottom: 6px; } .rp-jask { font-size: 13px; color: #bfdbfe; }
.rp-jrow { display: flex; gap: 8px; margin-bottom: 4px; } .rp-jrow input { flex: 1; height: 40px; font: inherit; font-size: 14px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--sunk); color: var(--text); }

/* ---- Logic Viewer (logicview.js): Controller Organizer on the left, one routine as live ladder on the right */
.lv { width: 100%; height: 100%; display: grid; grid-template-columns: 290px 1fr; gap: 8px; position: relative; }
.lv > div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.lv-h { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); padding: 10px 12px 6px; }
.lv-conns { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 8px 6px; }
.lv-conn { border: 1px solid var(--line); background: var(--sunk); color: var(--dim); border-radius: 8px; padding: 5px 9px; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.lv-conn.on { color: var(--text); border-color: var(--accent); background: var(--sel); }
.lv-q, .lv-find, .lv-goto { height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--input); color: var(--text); padding: 0 10px; font: inherit; font-size: 13px; }
.lv-q { margin: 0 8px 8px; }
.lv-tree { flex: 1; overflow: auto; padding: 0 6px 8px; font-size: 13px; }
.lv-ctl { padding: 4px 6px 8px; display: flex; flex-direction: column; } .lv-ctl b { font-size: 14px; } .lv-ctl .dim { font-size: 11.5px; }
.lv-sec { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); padding: 8px 6px 3px; }
.lv-sec .lv-task { text-transform: none; letter-spacing: 0; }
.lv-node { margin: 1px 0; }
.lv-task, .lv-pg, .lv-rt { width: 100%; text-align: left; display: flex; align-items: center; gap: 6px; border: 1px solid transparent; background: transparent; color: var(--text); border-radius: 8px; padding: 6px 8px; cursor: pointer; font: inherit; font-size: 13px; }
.lv-task:hover, .lv-pg:hover, .lv-rt:hover { background: var(--sunk); }
.lv-task { font-weight: 800; } .lv-pg { font-weight: 700; } .lv-pg.dis span { text-decoration: line-through; color: var(--dim); }
.lv-task em, .lv-pg em, .lv-rt em { margin-left: auto; font-style: normal; font-size: 10.5px; color: var(--dim); white-space: nowrap; }
.lv-car { width: 12px; color: var(--dim); font-weight: 400; }
.lv-kids { margin-left: 14px; border-left: 1px solid var(--line); padding-left: 4px; }
.lv-rt { padding: 5px 8px; } .lv-rt.on { border-color: var(--accent); background: var(--sel); }
.lv-rt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-ic { width: 18px; height: 18px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-style: normal; font-weight: 800; background: #1e3a8a; color: #bfdbfe; flex: none; }
.lv-ic.st { background: #4c1d95; color: #e9d5ff; } .lv-ic.fbd { background: #713f12; color: #fde68a; } .lv-ic.sfc { background: #064e3b; color: #a7f3d0; }
.lv-top { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.lv-b { height: 38px; min-width: 38px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-weight: 800; font-size: 15px; cursor: pointer; }
.lv-live { font-size: 12px; letter-spacing: .06em; color: var(--dim); } .lv-live.on { color: #86efac; border-color: #166534; background: #052e16; }
.lv-crumb { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 14px; }
.lv-crumb b { font-size: 16px; } .lv-cs { color: var(--dim); } .lv-rd { overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.lv-plc { font-size: 11px; font-weight: 800; background: var(--btn); color: #fff; border-radius: 6px; padding: 2px 7px; flex: none; }
.lv-type { font-size: 10.5px; font-weight: 800; color: var(--dim); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.lv-main-tag { font-size: 10px; font-weight: 800; color: #fde68a; font-style: normal; }
.lv-find { width: 240px; } .lv-goto { width: 76px; }
.lv-body { flex: 1; overflow: auto; padding: 6px 10px; }
.lv-empty { padding: 30px; color: var(--dim); max-width: 560px; } .lv-empty b { color: var(--text); font-size: 18px; }
.lv-rung { display: grid; grid-template-columns: 44px 1fr; gap: 6px; border-bottom: 1px solid var(--line); padding: 4px 0; }
.lv-rung.hit { background: #1e3a8a55; outline: 2px solid var(--accent); border-radius: 8px; }
.lv-rn { font-size: 12px; font-weight: 800; color: var(--dim); text-align: right; padding: 10px 6px 0 0; font-variant-numeric: tabular-nums; }
.lv-rb { min-width: 0; }
.lv-cmt { font-size: 12.5px; color: #a7f3d0; background: #052e1655; border-left: 3px solid #14532d; padding: 4px 8px; margin: 2px 0 2px; white-space: pre-wrap; border-radius: 0 6px 6px 0; }
.lv-lad { overflow-x: auto; } .lv-lad svg { display: block; }
.lv-lad text[data-tag], .lv-lad text[data-op="JSR"], .lv-lad text[data-aoi]:not([data-aoi=""]) { cursor: pointer; } .lv-lad text[data-tag]:hover { text-decoration: underline; }
.lv-end { font-size: 12px; color: var(--dim); padding: 8px 0 20px 50px; }
.lv-status { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 10px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--dim); }
.lv-status .warn { color: #fde68a; }
.lv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); display: inline-block; } .lv-dot.on { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.lv-legend { margin-left: auto; display: flex; gap: 8px; align-items: center; } .lv-legend i { width: 14px; height: 4px; display: inline-block; border-radius: 2px; margin-right: 3px; }
.lv-st { font: 12.5px/1.6 ui-monospace, Consolas, monospace; padding: 4px 0; }
.lv-stl { display: grid; grid-template-columns: 44px 1fr; gap: 6px; } .lv-stl:hover { background: var(--sunk); }
.lv-stn { color: var(--dim); text-align: right; padding-right: 6px; font-size: 11px; }
.lv-stl code { white-space: pre-wrap; word-break: break-word; }
.lv-sttag { cursor: pointer; border-bottom: 1px dotted var(--dim); } .lv-sttag i { font-style: normal; font-weight: 800; color: #fde68a; } .lv-sttag i.on { color: #86efac; } .lv-sttag i.off { color: var(--dim); }
.lv-pop { position: absolute; width: 360px; max-height: 340px; overflow: auto; background: var(--panel2); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 16px 40px #0009; padding: 8px 10px; z-index: 30; font-size: 12.5px; }
.lv-pt { display: flex; align-items: center; gap: 8px; } .lv-pt b { flex: 1; font-size: 13px; word-break: break-all; }
.lv-x { border: 0; background: transparent; color: var(--dim); font-size: 14px; cursor: pointer; }
.lv-xd { color: var(--dim); margin: 2px 0 4px; } .lv-xv { margin: 2px 0 6px; } .lv-xv b.on { color: #86efac; } .lv-xv b.off { color: var(--dim); }
.lv-xs { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin: 6px 0 3px; }
.lv-xr { width: 100%; text-align: left; display: flex; gap: 8px; align-items: center; border: 1px solid transparent; background: var(--sunk); color: var(--text); border-radius: 8px; padding: 5px 8px; margin: 2px 0; cursor: pointer; font: inherit; font-size: 12.5px; }
.lv-xr:hover { border-color: var(--accent); } .lv-xr span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .lv-xr em { font-style: normal; color: var(--dim); font-size: 11px; white-space: nowrap; }
.ts-lvo { border: 1px solid var(--line); background: var(--sunk); color: #7dd3fc; border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 800; cursor: pointer; }

/* ---------- Rail layout (rail.js): 64 px navigation rail on the left, slim header, screens in a flyout */
body.rail #app { display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto auto; }
body.rail.jnp-open #app { grid-template-columns: 64px minmax(0, 1fr) var(--jnpw, 400px); }
body.rail #rail { grid-column: 1; grid-row: 1 / -1; }
body.rail #top, body.rail #jnline, body.rail #etool, body.rail #work, body.rail #wbar, body.rail #nav { grid-column: 2; }
body.rail #top { grid-row: 1; } body.rail #jnline { grid-row: 2; } body.rail #etool { grid-row: 3; } body.rail #work { grid-row: 4; } body.rail #wbar { grid-row: 5; } body.rail #nav { grid-row: 6; display: none; }
body.rail #jnpanel { grid-column: 3; grid-row: 1 / -1; }
#rail { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0 8px; background: var(--nav); border-right: 1px solid var(--line2); min-height: 0; overflow: hidden; zoom: var(--ui-zoom); }
.rl-brand { width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; margin-bottom: 6px; padding: 0; }
.rl-brand img { max-width: 40px; max-height: 40px; display: block; }
.rl-i { position: relative; width: 52px; height: 52px; border: 0; border-radius: 11px; background: transparent; color: var(--dim); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; padding: 0; }
.rl-i span { font-size: 9.5px; font-weight: 700; letter-spacing: .02em; line-height: 1; }
.rl-i:hover { background: var(--panel2); color: var(--text); }
.rl-i.on { background: var(--sel); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.rl-i.locked { color: #fff; background: #7f1d1d; animation: blinkb 2s infinite; }
.rl-b { position: absolute; top: 3px; right: 4px; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 800; text-align: center; }
.rl-b.bad { background: var(--fault); color: #fff; animation: blinkb 2s infinite; } .rl-b.ack { background: var(--fault); color: #fff; } .rl-b.warn { background: var(--warn); color: #1c1307; }
.rl-sp { flex: 1; }
.rl-remote { color: #ed2c40; } .rl-remote img { height: 20px; display: block; }
.rl-u { width: 40px; height: 40px; margin-top: 4px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel2); color: var(--dim); font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.rl-u.in { background: var(--btn); border-color: var(--btn); color: #fff; }
body.rail #top { height: 48px; gap: 12px; padding: 0 16px; background: var(--header); }
body.rail #brand { display: none; }
body.rail #scrname { text-align: left; font-size: 18px; font-weight: 600; letter-spacing: 0; text-transform: none; }
body.rail .topright { gap: 8px; }
body.rail .topright > :not(#almpill):not(#connpill):not(#clock) { display: none !important; }
body.rail .pill { height: 32px; padding: 0 10px; font-size: 12px; border-radius: 16px; }
body.rail .pill.ok { background: transparent; border-color: transparent; }
body.rail #almpill.ok { display: none !important; }
body.rail #clock { font-size: 16px; min-width: 0; display: flex; align-items: baseline; gap: 6px; }
body.rail #clock small { display: inline; margin: 0; }
body.rail.editmode .rl-i[data-rl="lock"], body.rail.editmode .rl-i[data-rl="power"] { display: none; }
#railmenu { position: absolute; left: 64px; top: 0; bottom: 0; width: 320px; background: var(--panel); border-right: 1px solid var(--line); box-shadow: 12px 0 40px #0008; z-index: 40; display: flex; flex-direction: column; zoom: var(--ui-zoom); }
.rm-h { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; }
.rm-h > span { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.rm-area { display: flex; align-items: center; gap: 10px; margin: 0 12px 6px; padding: 8px 12px; border-radius: 10px; background: var(--sel); border: 1px solid var(--accent); font-size: 13px; font-weight: 800; } .rm-area small { font-weight: 500; color: var(--dim); } .rm-area span { flex: 1; } .rm-area.all { background: var(--panel2); border-color: var(--line); }
.rm-area button { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 800; cursor: pointer; }
.pv { display: inline-block; margin: 0 8px 2px 0; white-space: nowrap; } .pv small { color: var(--dim); font-size: 11px; }
.rm-empty { padding: 12px; color: var(--dim); font-size: 13px; }
.etable tr.me td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.rm-s { flex: 1; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--input); color: var(--dim); }
.rm-s input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; outline: none; }
.rm-x { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel2); color: var(--dim); cursor: pointer; }
.rm-list { flex: 1; overflow: auto; padding: 0 8px 12px; display: flex; flex-direction: column; gap: 3px; }
.rm-sec { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); padding: 12px 8px 4px; }
.rm-i { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 10px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text); font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; }
.rm-i:hover { background: var(--panel2); } .rm-i.on { background: var(--sel); border-color: var(--accent); }
.rm-c { width: 4px; height: 26px; border-radius: 2px; background: var(--c); flex: none; }
.rm-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-i small { font-size: 11px; color: var(--dim); font-weight: 400; }
.rm-i.locked { color: var(--dim); } .rm-l::before { content: '🔒'; font-size: 12px; }
body.phone #rail, body.phone #railmenu { display: none !important; }

/* ---------- Johnny's line and panel (jnpanel.js, rail layout) */
#jnline { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 16px; font-size: 13.5px; border-bottom: 1px solid var(--line2); background: var(--panel); color: var(--text); zoom: var(--ui-zoom); }
#jnline.sev-high { background: color-mix(in srgb, var(--fault) 14%, var(--panel)); border-color: color-mix(in srgb, var(--fault) 45%, var(--line2)); color: color-mix(in srgb, var(--fault) 35%, var(--text)); } #jnline.sev-mid { background: color-mix(in srgb, var(--warn) 10%, var(--panel)); border-color: color-mix(in srgb, var(--warn) 35%, var(--line2)); color: color-mix(in srgb, var(--warn) 35%, var(--text)); } #jnline.sev-low, #jnline.sev-note { background: var(--panel); border-color: var(--line2); color: var(--text); }
#jnline svg { flex: none; }
.jl-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jl-open { height: 28px; padding: 0 12px; border-radius: 7px; border: 1px solid currentColor; background: transparent; color: inherit; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.jl-n { font-size: 12px; opacity: .8; white-space: nowrap; }
#jnpanel { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-left: 1px solid var(--line2); zoom: var(--ui-zoom); }
.jp-h { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 6px 0 14px; border-bottom: 1px solid var(--line2); background: var(--header); flex: none; }
.jp-avi { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.jp-ht { display: flex; flex-direction: column; min-width: 0; } .jp-ht b { font-size: 15px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jp-live { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--dim); white-space: nowrap; } .jp-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--run); box-shadow: 0 0 6px var(--run); flex: none; }
.jp-sp { flex: 1; }
.jp-hb { display: flex; }
.jp-x { width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--dim); display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; } .jp-x:hover { background: var(--panel2); color: var(--text); } .jp-x svg { width: 18px; height: 18px; }
#jnpanel .jn-h { display: none; }   /* the panel's own header carries the chat's buttons */
.jp-chat { flex: 1; min-height: 220px; display: flex; } .jp-chat > .jn { flex: 1; min-width: 0; height: auto; }
.jp-att { flex: none; display: flex; flex-direction: column; min-height: 0; border-bottom: 1px solid var(--line2); }
.jp-atth { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 42px; padding: 6px 12px 6px 14px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.jp-atth b { font-weight: 700; white-space: nowrap; } .jp-atts { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
.jp-chev { flex: none; color: var(--dim); transition: transform .15s; } .jp-att.open .jp-chev { transform: rotate(180deg); }
.jp-att.sev-high .jp-atth { background: color-mix(in srgb, var(--fault) 14%, transparent); } .jp-att.sev-high .jp-atth > .jp-dot { background: var(--fault); }
.jp-att.sev-mid .jp-atth { background: color-mix(in srgb, var(--warn) 10%, transparent); } .jp-att.sev-mid .jp-atth > .jp-dot { background: var(--warn); }
.jp-att.sev-low .jp-atth > .jp-dot, .jp-att.sev-note .jp-atth > .jp-dot { background: var(--text2); } .jp-att.clear .jp-atth > .jp-dot { background: var(--run); }
.jp-body { max-height: min(36vh, 320px); overflow: auto; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line2); }
.jp-body[hidden] { display: none; }
.jp-body { flex: 1; overflow: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 10px; }
.jp-sec { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-top: 4px; }
.jp-card { border: 1px solid var(--line2); background: var(--panel); border-radius: 8px; padding: 11px 12px; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.jp-card p { margin: 0; line-height: 1.4; } .jp-card .jp-sub { font-size: 12.5px; color: var(--text2); }
.jp-card.alarm { border-color: color-mix(in srgb, var(--fault) 55%, var(--line2)); background: color-mix(in srgb, var(--fault) 10%, var(--panel)); } .jp-card.alarm .jp-ch { color: color-mix(in srgb, var(--fault) 60%, var(--text)); }
.jp-card.sev-high { border-color: color-mix(in srgb, var(--fault) 55%, var(--line2)); } .jp-card.sev-high .jp-dot { background: var(--fault); }
.jp-card.sev-mid { border-color: color-mix(in srgb, var(--warn) 45%, var(--line2)); } .jp-card.sev-mid .jp-dot { background: var(--warn); }
.jp-card.sev-low .jp-dot, .jp-card.sev-note .jp-dot { background: var(--accent); }
.jp-card.acked { opacity: .85; }
.jp-ch { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--dim); }
.jp-kind { font-weight: 800; letter-spacing: .06em; }
.jp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.jp-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.jp-b { height: 32px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.jp-b.pri { background: var(--fault); border-color: var(--fault); color: #fff; }
.jp-lock { font-size: 11px; }
.jp-row { display: flex; gap: 10px; padding: 6px 2px; border-bottom: 1px solid var(--line2); font-size: 13px; }
.jp-row .jp-dot { margin-top: 6px; } .jp-row .jp-dot.sev-high { background: var(--fault); } .jp-row .jp-dot.sev-mid { background: var(--warn); } .jp-row .jp-dot.sev-low { background: var(--accent); }
.jp-row > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.jp-empty { margin: 0; }
body.phone #jnline, body.phone #jnpanel { display: none !important; }

/* ---------- Flat skin (theme presets with flat: true, e.g. ACS): no gradients or bevels, hairline borders, 8 px corners */
body.flat { font-variant-numeric: tabular-nums; }
body.flat #top { background: var(--header); }
body.flat .navb { border-radius: 8px; background: var(--panel); border: 1px solid var(--line2); color: var(--text2); } body.flat .navb::before { left: 0; right: 0; height: 3px; border-radius: 0; opacity: 1; }
body.flat .navb.on { background: var(--sel); color: var(--text); border-color: var(--accent); }
body.flat .w-value { border-radius: 8px; border-color: var(--line2); }
body.flat .w-cap { font-size: 11px; font-weight: 600; letter-spacing: .06em; }
body.flat .w-num { font-weight: 600; }
body.flat .w-btn { border-radius: 8px; border: 1px solid color-mix(in srgb, var(--c) 70%, #000 30%); background: var(--c); box-shadow: none; font-weight: 700; letter-spacing: .02em; }
body.flat .w-btn:active, body.flat .w-btn.pressed { transform: none; box-shadow: inset 0 0 0 2px #ffffff55; filter: brightness(1.1); }
body.flat .w-btn.lit { background: var(--lit, var(--c)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--lit, var(--c)) 60%, transparent); }
body.flat .w-field { border-radius: 8px; border-width: 1px; border-color: var(--line); }
body.flat .w-arrow { background: var(--panel2); border-radius: 8px; }
body.flat .w-lampdot { background: var(--c); border: 1px solid #0006; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
body.flat .w-ms { box-shadow: none; border-radius: 8px; font-weight: 700; letter-spacing: .04em; }
body.flat .w-segs { border-radius: 8px; border: 1px solid var(--line2); background: var(--sunk); gap: 2px; padding: 2px; }
body.flat .w-seg { border-radius: 6px; font-weight: 700; } body.flat .w-seg.on { box-shadow: none; }
body.flat .w-panel { box-shadow: none; } body.flat .w-panel-accent { height: 2px; }
body.flat .w-panel-title { font-size: 11px; font-weight: 600; letter-spacing: .1em; }
body.flat .w-trend { border-radius: 8px; background: var(--panel); border-color: var(--line2); }
body.flat .w-trend-head b { font-weight: 600; letter-spacing: .06em; }
body.flat .w-mcard, body.flat .w-vcard, body.flat .w-acard { border-radius: 8px; border-color: var(--line2); background: var(--panel); }
body.flat .w-mcard { border-left-width: 3px; } body.flat .w-vcard { border-top-width: 3px; }
body.flat .w-mcard.fault, body.flat .w-vcard.fault, body.flat .w-acard.fault, body.flat .w-scard.fault { background: #1f0d12; }
body.flat .w-mst { padding: 2px 7px; border-radius: 6px; background: var(--sunk); color: var(--dim); font-weight: 700; letter-spacing: .06em; }
body.flat .w-mcard.run .w-mst { background: #052e16; color: #86efac; } body.flat .w-mcard.fault .w-mst { background: #450a0a; color: #fecaca; }
body.flat .w-mnum { border-radius: 6px; font-weight: 600; }
body.flat .w-mcard-f div { border-radius: 6px; background: var(--sunk); }
body.flat .w-vbar-t { border-radius: 6px; } body.flat .w-vbar-f { background: var(--c); border-radius: 4px; }
body.flat .w-afill { background: var(--c); border-radius: 4px; }
body.flat .w-scard { border-radius: 8px; background: var(--panel); border-color: var(--line2); }
body.flat .w-scard-h b { font-weight: 600; letter-spacing: .04em; } body.flat .w-scard-h .w-mnum { background: var(--btn); color: #fff; border-radius: 6px; }
body.flat .w-sfill { background: var(--c); border-radius: 4px; }
body.flat .w-strack { border-radius: 6px; }
body.flat .w-pill { border-radius: 6px; font-weight: 700; }
body.flat .w-acard-h i { border-radius: 5px; background: var(--sunk); }
body.flat .w-alist, body.flat .w-alist-h { border-radius: 8px; }
body.flat .pill { border-radius: 8px; font-weight: 700; letter-spacing: .02em; }
body.flat .jnbtn, body.flat .jnbtn.on { background: var(--panel2); border-color: var(--line); } body.flat .jnbtn.on { border-color: var(--accent); }
body.flat .jn-h { background: var(--panel2); }
body.flat .ts-why { background: var(--accent); border-radius: 8px; }
body.flat .kpk, body.flat .oskk { background: var(--panel2); }
body.flat .g-go { background: var(--btn); border-radius: 10px; }
body.flat .editbtn, body.flat .wbbtn, body.flat .userbtn, body.flat .lockbtn, body.flat .pwrbtn, body.flat .poweredby { border-radius: 8px; }

/* feedback on Johnny: Helpful / Not helpful / Incorrect under findings and answers */
.fb-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; min-height: 28px; } .fb-row.jn-fb { margin-top: 4px; }
.fb-b { height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--text); font-size: 12px; cursor: pointer; } .fb-b:hover { border-color: var(--text); } .fb-b.fb-incorrect:hover { border-color: var(--fault); color: var(--fault); }
.fb-in { flex: 1; min-width: 160px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 0 8px; font: 12px/1.2 inherit; }
.jp-fb { margin-top: 2px; } .jp-x[data-watch] { margin-right: 2px; }

/* bale log widgets: the board of gin positions and the log table */
.w-bales { width: 100%; height: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; font-variant-numeric: tabular-nums; }
.w-bales-h { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14px; } .w-bales-h b { font-size: 15px; } .w-bales-s { margin-left: auto; color: var(--muted, #8aa0b6); font-size: 12px; }
.w-stale { margin-left: auto; font-size: 12px; font-weight: 700; color: #fbbf24; } .w-bales.stale .w-flow-b, .w-bales.stale .w-board-row, .w-bales.stale .w-bales-b { opacity: .45; filter: grayscale(.6); }
.w-flow-b { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; flex: 1; min-height: 0; overflow: auto; }
.w-flow-lane { display: flex; gap: 8px; align-items: stretch; } .w-flow-ln { flex: 0 0 96px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--dim, #8aa0b6); padding-top: 8px; }
.w-flow-row { display: flex; gap: 6px; flex: 1; min-width: 0; }
.w-flow-c { flex: 1 1 0; max-width: 480px; min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 6px 9px; display: flex; flex-direction: column; gap: 2px; opacity: .5; background: #ffffff06; }
.w-flow-c.on { opacity: 1; border-color: hsl(var(--h, 210) 55% 45%); background: hsl(var(--h, 210) 45% 22% / .55); box-shadow: inset 3px 0 0 hsl(var(--h, 210) 70% 55%); } .w-flow-c.on.bale { border-style: solid; } .w-flow-c.on.mod { border-radius: 14px; }
.w-flow-n { font-size: 11px; color: var(--dim, #8aa0b6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .w-flow-v { font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .w-flow-v.dim { color: var(--dim, #8aa0b6); font-weight: 500; }
.w-flow-m { font-size: 12px; color: var(--text, #e3ebf3); opacity: .85; line-height: 1.3; overflow-wrap: anywhere; } .w-flow-m .mono { font-family: ui-monospace, Consolas, monospace; }
.w-flow.compact .w-flow-m { display: none; } .w-flow.compact .w-flow-v { font-size: 14px; } .w-flow.compact .w-flow-c { padding: 4px 8px; }
/* a lane with more than five positions (press and bagging) wraps into rows of five, the same width as the gin lane, so nothing is cut off */
.w-flow-lane.many .w-flow-row { flex-wrap: wrap; } .w-flow-lane.many .w-flow-c { flex: 0 0 calc(20% - 5px); max-width: calc(20% - 5px); }
body.phone .w-flow-lane { flex-direction: column; gap: 2px; } body.phone .w-flow-row { flex-wrap: wrap; } body.phone .w-flow-c, body.phone .w-flow-lane.many .w-flow-c { flex: 1 1 140px; max-width: none; } body.phone .w-flow-ln { flex: none; padding-top: 4px; } body.phone .w-flow-c { flex: 1 1 140px; }
.w-board-row { display: flex; gap: 8px; padding: 8px 10px; flex: 1; min-height: 0; } .w-board-empty { color: var(--muted, #8aa0b6); font-size: 13px; padding: 8px; }
.w-board-c { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; opacity: .55; } .w-board-c.on { opacity: 1; } .w-board-c.stand.on { border-color: var(--accent, #39b3ff); box-shadow: inset 0 0 0 1px var(--accent, #39b3ff); } .w-board-c.bag { border-style: dashed; }
.w-board-n { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #8aa0b6); } .w-board-v { font-size: 20px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .w-board-m { font-size: 12px; color: var(--muted, #8aa0b6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-hcount-b { flex: 1; min-height: 0; overflow: auto; padding: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; align-content: start; }
.w-hcount-c { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; text-align: center; background: color-mix(in srgb, var(--panel2, #1a2531) 70%, transparent); }
.w-hcount-c .v { font-size: 12px; letter-spacing: .04em; color: var(--muted, #8aa0b6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .w-hcount-c .n { font-size: 26px; font-weight: 700; line-height: 1.15; } .w-hcount-c .u { font-size: 11px; color: var(--muted, #8aa0b6); }
.w-hcount-c.zero .n { opacity: .4; } .w-hcount-c.tot { background: color-mix(in srgb, var(--accent, #2d7ff9) 18%, transparent); border-color: color-mix(in srgb, var(--accent, #2d7ff9) 50%, var(--line)); }
.w-hcount-none { grid-column: 1 / -1; color: var(--muted, #8aa0b6); text-align: center; padding: 18px; } .w-bales.stale .w-hcount-b { opacity: .45; filter: grayscale(.6); }
.w-bales-sum { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 10px 0; } .w-bales-sum:empty { display: none; } .w-bales-chip { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.w-bales-b { flex: 1; min-height: 0; overflow: auto; padding: 6px 10px 10px; } .w-bales-b table { width: 100%; border-collapse: collapse; font-size: 13px; } .w-bales-b th { text-align: left; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #8aa0b6); padding: 4px 6px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
.w-bales-b th.num, .w-bales-b td.num { text-align: right; } .w-bales-b td { padding: 5px 6px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); white-space: nowrap; } .w-bales-b tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--panel2, #1a2531) 70%, transparent); } .w-bales-b tr.open td { opacity: .8; } .w-bales-b td.none { color: var(--muted, #8aa0b6); text-align: center; padding: 18px; }

.scrpick { display: flex; flex-direction: column; gap: 8px; padding: 8px 4px; } .scrpick label { display: flex; align-items: center; gap: 8px; font-size: 14px; } .scrgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 14px; padding: 4px 0 4px 22px; }

#viewas { position: fixed; left: 0; right: 0; top: 0; z-index: 9500; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 8px 14px; background: #b45309; color: #fff; font-size: 14px; box-shadow: 0 2px 10px #0006; } #viewas button { background: #fff; color: #7c2d12; border: 0; border-radius: 8px; padding: 6px 12px; font-weight: 800; cursor: pointer; } body:has(#viewas) #top { margin-top: 38px; }

/* ---- Excubo brand gate (2026-11): navy, the E | EXCUBO by ACS lockup, Montserrat on the form, red pill button.
   #gate[data-grad] picks the background: streak (the brand's red-to-blue light), glow, dusk, silver, plain. */
#gate { background: #1D1447; font-family: Montserrat, var(--font); color: #fff; }
#gate .g-bg.g-wm { opacity: .04; } #gate .g-bg.g-wm .xb-e { width: 120px; height: 100px; transform: rotate(-12deg); fill: #fff; }
#gate .g-bg.g-grad { display: block; opacity: 1; }   /* the gradient layer is a .g-bg too, which fades watermarks to 4%: this one shows in full */
#gate[data-grad="streak"] .g-grad { background: linear-gradient(118deg, rgba(255,0,46,0) 38%, rgba(255,0,46,.34) 52%, rgba(0,102,255,.26) 62%, rgba(0,102,255,0) 76%); }
#gate[data-grad="glow"] .g-grad { background: radial-gradient(ellipse 60% 70% at 8% 100%, rgba(255,0,46,.45) 0%, rgba(255,0,46,0) 60%), radial-gradient(ellipse 55% 60% at 100% 0%, rgba(0,102,255,.38) 0%, rgba(0,102,255,0) 60%); }
#gate[data-grad="dusk"] .g-grad { background: linear-gradient(180deg, rgba(0,102,255,.16) 0%, rgba(29,20,71,0) 45%, rgba(255,0,46,.42) 100%); }
#gate[data-grad="silver"] .g-grad { background: linear-gradient(135deg, rgba(244,245,247,.22) 0%, rgba(174,179,189,.10) 30%, rgba(29,20,71,0) 55%, rgba(255,0,46,.18) 100%); }
#gate[data-grad="plain"] .g-grad { background: none; }
#gate .g-card { background: #141038; border-color: #2b2560; box-shadow: 0 40px 120px rgba(0,0,0,.6), inset 0 1px 0 #ffffff14; }
#gate .g-brand { background: linear-gradient(170deg, #1D1447 0%, #120c33 100%); color: #fff; align-items: flex-start; text-align: left; gap: 18px; padding: 34px 30px; border-right: 1px solid #2b2560; }
#gate .xb-lock { display: flex; align-items: center; gap: 16px; } #gate .xb-lock .xb-e { width: 88px; height: 74px; fill: #FF002E; flex: none; }
#gate .xb-rule { width: 2px; height: 68px; background: #fff; opacity: .5; }
#gate .xb-words { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
#gate .xb-name { font-family: Michroma, Montserrat, var(--font); font-style: italic; font-size: 32px; letter-spacing: .02em; line-height: 1; color: #fff; }
#gate .xb-by { display: flex; align-items: center; gap: 7px; } #gate .xb-by i { font-style: italic; font-weight: 600; font-size: 14px; color: #fff; } #gate .xb-by img { height: 20px; width: auto; }
#gate .xb-fam { display: flex; align-items: center; gap: 12px; color: #FF002E; } #gate .xb-fam svg { width: 38px; height: 38px; }
#gate .xb-fam small { display: block; font-family: Michroma, Montserrat, var(--font); font-style: italic; font-size: 13px; color: #fff; line-height: 1.1; }
#gate .xb-fam b { display: block; font-size: 20px; font-weight: 600; letter-spacing: .06em; color: #fff; line-height: 1.1; } #gate .xb-fam b em { font-style: normal; color: #c9c5e6; }
#gate .xb-plant { display: flex; flex-direction: column; gap: 4px; } #gate .xb-plant .g-logo { width: 150px; max-height: 110px; margin-bottom: 6px; }
#gate .g-brand h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0; color: #fff; } #gate .g-brand p { color: #c9c5e6; font-size: 14px; }
#gate .xb-tiles { display: flex; gap: 8px; width: 100%; }
#gate .xb-tile { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px; border-radius: 10px; background: #1D1447; border: 1px solid #2b2560; color: #FF002E; }
#gate .xb-tile svg { width: 26px; height: 26px; } #gate .xb-tile span { font-size: 10px; font-weight: 600; letter-spacing: .08em; color: #fff; }
#gate .g-tag { color: #8a90a8; font-size: 12px; margin-top: auto; }
#gate .g-x, #gate .g-acs { display: none; }
#gate .g-form { background: #141038; color: #fff; } #gate .g-form h2 { font-weight: 700; letter-spacing: 0; } #gate .g-form > p.dim { color: #c9c5e6; }
#gate .g-form label { color: #E5E7EB; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
#gate .bigin { background: #0f0b2a; border: 1px solid #2b2560; color: #fff; border-radius: 10px; font-family: inherit; } #gate .bigin:focus { border-color: #0066FF; outline: none; box-shadow: 0 0 0 3px #0066ff33; }
#gate .utile { background: #1D1447; border: 1px solid #2b2560; color: #fff; border-radius: 12px; } #gate .utile.on { border-color: #0066FF; box-shadow: 0 0 0 2px #0066ff55; } #gate .utile small { color: #c9c5e6; }
#gate .g-go { height: 54px; border-radius: 999px; background: #FF002E; color: #fff; font-family: inherit; font-size: 16px; font-weight: 700; letter-spacing: .06em; display: inline-flex; align-items: center; justify-content: center; gap: 12px; box-shadow: none; }
#gate .g-go span { font-size: 22px; line-height: 1; } #gate .g-go:hover { background: #ff1f47; }
#gate .g-forgot { color: #9cc3ff; font-weight: 600; } #gate .cerr { color: #ff6b84; }
#gate .g-foot { color: #8a90a8; } #gate .g-foot .dim { color: #8a90a8; }
#gate .osk .k { background: #1D1447; border-color: #2b2560; color: #fff; }
@media (max-width: 900px) { #gate .g-brand { align-items: center; text-align: center; border-right: 0; border-bottom: 1px solid #2b2560; } #gate .xb-plant { align-items: center; } #gate .xb-lock .xb-e { width: 74px; height: 62px; } #gate .xb-name { font-size: 26px; } #gate .g-tag { display: none; } }
body.phone #gate .g-brand { padding: 22px 16px 16px; gap: 12px; } body.phone #gate .xb-tiles { display: none; } body.phone #gate .xb-fam { display: none; }
body.phone #gate .xb-plant .g-logo { width: 90px; } body.phone #gate .g-brand h1 { font-size: 18px; }
@media (max-width: 600px) {
  #gate .g-card { width: 100%; max-width: 100%; min-width: 0; grid-template-columns: minmax(0, 1fr); }
  #gate .g-brand { flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 18px 14px 14px; border-right: 0; border-bottom: 1px solid #2b2560; }
  #gate .xb-lock { gap: 12px; } #gate .xb-lock .xb-e { width: 66px; height: 55px; } #gate .xb-rule { height: 52px; } #gate .xb-name { font-size: 24px; } #gate .xb-by img { height: 16px; }
  #gate .xb-fam svg { width: 28px; height: 28px; } #gate .xb-fam b { font-size: 16px; } #gate .xb-fam small { font-size: 11px; }
  #gate .xb-plant { align-items: center; } #gate .xb-plant .g-logo { width: 90px; max-height: 70px; } #gate .g-brand h1 { font-size: 18px; } #gate .g-brand p { font-size: 13px; }
  #gate .xb-tiles, #gate .g-tag { display: none; }
  #gate .g-form { min-width: 0; padding: 16px; } #gate .credrow { flex-direction: column; } #gate .g-go { height: 52px; }
}
/* 1.49.1 - a short phone screen must scroll the login, not squash it: the card is a flex child, and flex-shrink plus the card's
   overflow:hidden used to clip the password box and SIGN IN off the bottom with nothing to scroll to. */
#gate { justify-content: flex-start; -webkit-overflow-scrolling: touch; }
#gate > .g-card { flex-shrink: 0; margin-top: auto; }
#gate > .g-foot { flex-shrink: 0; margin-bottom: auto; }
/* ---- Recipes (generic edition, 1.50.0): the Recipes window and the Recipe Loader graphic */
.rc-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.rc-tab { height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.rc-tab small { font-weight: 600; color: var(--dim); } .rc-tab.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--panel2)); } .rc-tab.rc-new { border-style: dashed; color: var(--dim); }
.rc-bookhead { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap; font-size: 15px; }
.rc-active, .w-rc-active { font-size: 13px; color: var(--dim); padding: 6px 10px; border-radius: 9px; background: var(--panel2); border: 1px solid var(--line); }
.rc-active.ok, .w-rc-active.ok { border-color: #16a34a66; color: #86efac; } .rc-active.warn, .w-rc-active.warn { border-color: #f59e0b88; color: #fde68a; }
.rc-table td { vertical-align: top; } .rc-act { white-space: nowrap; text-align: right; } .rc-act .eb { margin-left: 6px; }
.rc-table tr.rc-current td { background: color-mix(in srgb, var(--accent) 8%, transparent); } .rc-pill { font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 2px 7px; border-radius: 999px; background: #166534; color: #bbf7d0; vertical-align: middle; }
.rc-table tr.rc-diff td { background: #4a2a0a66; color: #fde68a; } .rc-table tr.rc-bad td { background: #4a0a0a66; color: #fecaca; } .rc-table tr.rc-ok td:last-child { color: #86efac; font-weight: 700; }
.rc-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; } .rc-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--dim); flex: 1; min-width: 150px; }
.rc-f > input, .rc-f > select { height: 38px; font: inherit; font-size: 14px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--sunk); color: var(--text); width: 100%; box-sizing: border-box; }
.rc-tagpick { display: flex; gap: 4px; align-items: center; } .rc-tagpick input { flex: 1; min-width: 0; } .rc-tagpick .eb { height: 36px; }
.rc-params input, .rc-params select { height: 36px; box-sizing: border-box; font: inherit; font-size: 13.5px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--sunk); color: var(--text); width: 100%; }
.rc-val input, .rc-val select { height: 38px; width: 140px; font: inherit; font-size: 15px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--sunk); color: var(--text); }
.rc-hist { margin-top: 8px; font-size: 13px; } .rc-histrow { padding: 4px 0; border-top: 1px solid var(--line); }
.modal.rc-result { width: min(640px, 94vw); }
.w-recipe { height: 100%; box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.w-recipe .w-cap { font-weight: 700; letter-spacing: .04em; }
.w-rc-row { display: flex; gap: 8px; align-items: stretch; flex: 1; min-height: 44px; }
.w-rc-row select { flex: 1; min-width: 0; font: inherit; font-size: 1em; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--sunk); color: var(--text); }
.w-rc-go { width: auto; flex: 0 0 auto; padding: 0 22px; font-weight: 800; letter-spacing: .08em; } .w-rc-cmp { height: auto; }
body.phone .w-recipe { min-height: 140px; }
.w-recipe .w-rc-row { min-height: 48px; } .w-recipe .w-rc-row > * { height: auto; min-height: 46px; }   /* the phone layout gives the graphic its content height, so no percent heights here */
/* batching (1.51.0): the Batch Control graphic, the start dialog and the batch record */
.w-rc-active.run, .rc-active.run { border-color: #2563eb88; color: #bfdbfe; } .rc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3b82f6; margin-left: 2px; }
.w-bt-size { display: flex; flex-direction: column; gap: 2px; font-size: .75em; color: var(--dim); min-width: 90px; } .w-bt-size input { height: 46px; width: 100px; font: inherit; font-size: 1.25em; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--sunk); color: var(--text); box-sizing: border-box; }
.w-bt-cmds { display: flex; gap: 8px; min-height: 46px; } .w-bt-cmds .w-btn { height: auto; min-height: 46px; width: auto; flex: 1; font-weight: 800; letter-spacing: .06em; }
.rc-table tr.rc-scaled td { color: #bfdbfe; }
.rc-batchset { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); } .rc-batchset summary { cursor: pointer; font-size: 14px; } .rc-batchset .rc-row { margin-top: 10px; } .rc-batchset textarea { font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--sunk); color: var(--text); width: 100%; box-sizing: border-box; resize: vertical; }
.rc-record { font-size: 13.5px; } .rc-record h2 { margin: 0 0 8px; font-size: 20px; } .rc-record h3 { margin: 14px 0 4px; font-size: 14px; color: var(--dim); letter-spacing: .04em; text-transform: uppercase; }
.rc-record table { width: 100%; border-collapse: collapse; } .rc-record td, .rc-record th { border-bottom: 1px solid var(--line); padding: 5px 7px; text-align: left; vertical-align: top; } .rc-record th { font-size: 12px; color: var(--dim); }
.rc-kv td:nth-child(odd) { color: var(--dim); width: 12%; } .rc-foot { color: var(--dim); font-size: 12px; margin-top: 14px; }
/* ---- Report a problem to ACS (js/bugreport.js) */
.bug-modal { width: 560px; } .bug-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; } .bug-head .jn-av { width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto; } .bug-head h3 { margin: 0 0 4px; } .bug-head p { margin: 0; }
.bug-in { width: 100%; box-sizing: border-box; margin-bottom: 4px; } textarea.bug-in { resize: vertical; min-height: 84px; } .bug-with { margin: 8px 0 0; }
.bug-modal .mrow .flex { flex: 1; } .bug-steps { margin: 8px 0; } .bug-st { min-height: 1.2em; }
.bug-ans { background: var(--panel2, rgba(127,127,127,.08)); border-radius: 10px; padding: 10px 14px; margin-top: 8px; } .bug-ans p { margin: 6px 0; } .bug-ans ol { margin: 4px 0; padding-left: 22px; } .bug-title { font-weight: 700; font-size: 15px; }
.bug-sev { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; color: #fff; background: #1d4ed8; vertical-align: middle; } .bug-sev.s2 { background: #b45309; } .bug-sev.s3 { background: #b91c1c; } .bug-sev.s4 { background: #7f1d1d; }
.bug-list { width: 100%; border-collapse: collapse; font-size: 13px; } .bug-list th, .bug-list td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line, rgba(127,127,127,.25)); vertical-align: top; } .bug-list td:last-child { white-space: nowrap; } .bug-list .mb.sm { margin: 0 4px 4px 0; }
body.phone .bug-modal { width: 100vw; }

/* ---- Production Scoreboard (widget kpiBoard) */
.w-kpi { width: 100%; height: 100%; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; container-type: size; }
.w-kpi-msg { margin: auto; padding: 16px; color: var(--dim, #8b98a8); text-align: center; }
.w-kpi-head { display: flex; align-items: baseline; gap: 14px; padding: 10px 16px; color: #fff; }
.w-kpi-head b { font-size: clamp(16px, 5cqh, 30px); letter-spacing: .04em; } .w-kpi-head span { font-size: clamp(13px, 4cqh, 24px); font-weight: 700; letter-spacing: .06em; }
.w-kpi-timer { margin-left: auto; font-variant-numeric: tabular-nums; }
.w-kpi-sub { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 6px 16px; font-size: 13px; color: var(--dim, #8b98a8); border-bottom: 1px solid var(--line); }
.w-kpi-sub b { color: var(--fg, #e3ebf3); }
.w-kpi-bigs { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); min-height: 0; }
.w-kpi-big { background: var(--panel); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px; min-width: 0; }
.w-kpi-big small, .w-kpi-fac small { font-size: clamp(10px, 3cqh, 15px); letter-spacing: .12em; text-transform: uppercase; color: var(--dim, #8b98a8); }
.w-kpi-big b { font-size: clamp(22px, min(20cqh, 7.6cqw), 120px); line-height: 1.05; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }   /* sized by the tile's width too, so a five-figure count stays inside it */
.w-kpi-facs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.w-kpi-fac { background: var(--panel); display: flex; flex-direction: column; align-items: center; padding: 6px 2px; }
.w-kpi-fac b { font-size: clamp(15px, 7cqh, 34px); font-variant-numeric: tabular-nums; }
.w-kpi-ask { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; overflow: auto; }
.w-kpi-ask > b { font-size: clamp(18px, 7cqh, 34px); color: #f87171; }
.w-kpi-hint { font-size: 14px; color: var(--fg, #e3ebf3); background: color-mix(in srgb, #f59e0b 18%, transparent); border-left: 4px solid #f59e0b; padding: 6px 10px; border-radius: 4px; }
.w-kpi-reasons { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.w-kpi-r { min-height: 48px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2, #1a2531); color: var(--fg, #e3ebf3); font-size: 15px; font-weight: 700; cursor: pointer; }
.w-kpi-r.unplanned { border-left: 5px solid #dc2626; } .w-kpi-r.changeover { border-left: 5px solid #d97706; } .w-kpi-r.excluded { border-left: 5px solid #2563eb; }
.w-kpi-ctl { display: flex; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); }
.w-kpi-ctl button { min-height: 40px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel2, #1a2531); color: var(--fg, #e3ebf3); font-weight: 700; cursor: pointer; }

/* ---- Display board: a station whose area is a display board shows its screens with no bars (tap the top edge to peek) */
body.board-mode:not(.board-peek) #top, body.board-mode:not(.board-peek) #nav, body.board-mode:not(.board-peek) #wbar { display: none !important; }
body.board-mode:not(.board-peek) .w-kpi-ctl { display: none; }
/* the Rail layout has more to put away: the rail itself, its menu, Johnny's line and panel. Johnny's window, his bubble
   and the pop-up cards that ask someone to acknowledge have no place on a screen nobody touches either. With the rail
   gone the page is a plain column again, so the screens take the whole width. */
body.board-mode:not(.board-peek) #rail, body.board-mode:not(.board-peek) #railmenu, body.board-mode:not(.board-peek) #jnline, body.board-mode:not(.board-peek) #jnpanel,
body.board-mode:not(.board-peek) #jndock, body.board-mode:not(.board-peek) #jnwin, body.board-mode:not(.board-peek) #jnbubble, body.board-mode:not(.board-peek) #netpop { display: none !important; }
body.rail.board-mode:not(.board-peek) #app { display: flex; flex-direction: column; }
#boardbar { display: none; }
body.board-mode:not(.board-peek) #boardbar { display: flex; align-items: center; justify-content: space-between; flex: none; height: 56px; padding: 0 20px; background: linear-gradient(var(--header), var(--nav)); border-bottom: 1px solid var(--line2); }
#boardbar .bb-left { display: flex; align-items: center; gap: 10px; }
#boardbar .bb-left img { height: 28px; width: auto; }
#boardbar .bb-left b { font-family: Michroma, Montserrat, var(--font); font-style: italic; font-size: 22px; letter-spacing: .02em; color: #fff; }
#boardbar .bb-left small { color: var(--dim, #8b98a8); font-size: 12px; }
#boardbar .bb-right { display: flex; align-items: center; }
#boardbar .bb-right img { max-height: 40px; max-width: 280px; display: block; }
#boardbar .bb-right b { font-size: 20px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg, #e3ebf3); }

/* ---- Production reports (js/kpi.js) and the wall-board timeline / stops widgets */
.modal.kr-modal { width: min(1400px, 97vw); max-height: 94vh; overflow: auto; }
.kr h4 { margin: 20px 0 6px; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--text2); }
.kr-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 4px 0 12px; border-bottom: 1px solid var(--line2); }
.kr-ctl label { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 13px; } .kr-ctl select { min-height: 38px; }
.kr-when { flex: 1; color: var(--dim); font-size: 13px; text-align: right; } .kr-ctl a.mb { text-decoration: none; display: inline-flex; align-items: center; }
.kr-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.kr-tile { background: var(--panel2); border: 1px solid var(--line2); border-left: 5px solid var(--line); border-radius: 10px; padding: 10px 14px; min-width: 0; }
.kr-tile small { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.kr-tile b { display: block; font-size: 30px; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--text); }
.kr-tile.big b { font-size: 44px; } .kr-tile span { display: block; font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kr-tile.good { border-left-color: var(--run); } .kr-tile.mid { border-left-color: var(--warn); } .kr-tile.low { border-left-color: var(--fault); }
.kr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.kr-bars { display: grid; gap: 7px; }
.kr-bar { display: grid; grid-template-columns: minmax(110px, 30%) 1fr auto; align-items: center; gap: 10px; font-size: 14px; }
.kr-bar-n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.kr-bar-t { height: 14px; display: block; } .kr-bar-t i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.kr-bar-v { color: var(--text2); font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.kr-bar:hover .kr-bar-t i, .kr-col:hover i { filter: brightness(1.25); }
.kr-strip { position: relative; height: 64px; border-bottom: 1px solid var(--line); margin: 0 22px; }
.kr-axis, .kr-legend { margin-left: 22px; margin-right: 22px; }
.kr-seg { position: absolute; bottom: 0; min-width: 1px; border-radius: 2px 2px 0 0; box-shadow: inset -1px 0 0 var(--panel), inset 1px 0 0 var(--panel); }
.kr-seg.down { background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(0, 0, 0, .28) 5px 8px) !important; }
.kr-seg:hover { filter: brightness(1.25); }
.kr-axis { position: relative; height: 18px; font-size: 11px; color: var(--dim); } .kr-axis span { position: absolute; top: 2px; transform: translateX(-50%); white-space: nowrap; }
.kr-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--text2); margin-top: 2px; }
.kr-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.kr-key.down { background-image: repeating-linear-gradient(135deg, transparent 0 3px, rgba(0, 0, 0, .3) 3px 5px); }
.kr-kind { white-space: nowrap; }
.kr-cols { display: flex; align-items: flex-end; gap: 2px; height: 120px; border-bottom: 1px solid var(--line); padding-top: 16px; }
.kr-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; max-width: 46px; }
.kr-col i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; } .kr-col span { font-size: 10px; color: var(--dim); line-height: 1.3; }
.kr-colx { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); margin: 3px 0 10px; }
.kr-table td, .kr-table th { white-space: nowrap; font-variant-numeric: tabular-nums; }
body.phone .kr-tiles { grid-template-columns: repeat(2, 1fr); } body.phone .kr-two { grid-template-columns: 1fr; }
.w-kpx .kr-strip { height: 56px; }
.w-kpx { width: 100%; height: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
.w-kpx-h { display: flex; align-items: baseline; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex: none; }
.w-kpx-h b { font-size: 16px; letter-spacing: .08em; text-transform: uppercase; }
.w-kpx-b { flex: 1; min-height: 0; overflow: auto; }
.w-kpx .kr-bar { font-size: 16px; } .w-kpx .kr-bar-t { height: 18px; }

/* ---- jobs: the strip on a scoreboard, and the job dialog (one hue for progress; "late" is said in words as well) */
.w-kpi-job { padding: 6px 16px 8px; border-bottom: 1px solid var(--line); }
.w-kpi-job-t { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; font-size: clamp(12px, 3.6cqh, 20px); color: var(--text2); }
.w-kpi-job-t b { color: var(--text); } .w-kpi-job.late .w-kpi-job-t span:last-child { color: var(--fault); font-weight: 700; }
.w-kpi-job-bar, .kr-prog { height: 8px; margin-top: 5px; background: var(--sunk); border-radius: 4px; overflow: hidden; }
.w-kpi-job-bar i, .kr-prog i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.kr-job { background: var(--panel2); border: 1px solid var(--line2); border-left: 5px solid var(--accent); border-radius: 10px; padding: 12px 16px; margin-top: 12px; }
.kr-job.late { border-left-color: var(--fault); }
.kr-job small { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); } .kr-job b { font-size: 22px; }
.kr-prog { height: 12px; margin: 10px 0 6px; } .kr-job-n { display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 15px; }
.kr-jobstart { display: flex; gap: 10px; align-items: center; } .kr-jobstart .bigin { flex: 1; max-width: 420px; }
.kr-jobnew { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; } .kr-jobnew label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--dim); } .kr-jobnew input, .kr-jobnew select { min-height: 40px; }

.w-kpi-r.on { outline: 3px solid var(--accent); background: var(--sel); }

/* Settings > Second server (redundant pair) */
.pr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 12px 0; }
.pr-card { border: 1px solid var(--line, #2a3441); border-radius: 10px; padding: 12px 16px; background: var(--panel2, rgba(255,255,255,.03)); }
.pr-card.on { border-color: #22c55e; } .pr-card h4 { margin: 0 0 2px; }
.pr-role { font-size: 20px; font-weight: 700; margin: 2px 0 6px; } .pr-role.ok, .pr-card.on .pr-role { color: #4ade80; } .pr-role.bad { color: #fca5a5; }
.pr-form input:not([type]), .pr-form input[type="number"] { padding: 6px 8px; } .pr-form > span { min-width: 0; } .pr-form > b { padding-top: 7px; }
.pr-form input:not([type]) { width: min(380px, 100%); } .pr-form label { display: block; margin: 3px 0; }
.pr-form .pr-opt { display: flex; align-items: center; gap: 10px; padding: 5px 0; margin: 0; } .pr-form .pr-opt em { font-style: normal; font-weight: 700; }
.pr-form .pr-opt input { flex: none; width: 18px; height: 18px; min-width: 0; min-height: 0; margin: 0; }
.pr-form button { margin-top: 6px; }
#lostbar button { margin-left: 12px; padding: 6px 12px; border-radius: 6px; border: 1px solid currentColor; background: transparent; color: inherit; font: inherit; cursor: pointer; }
@media (max-width: 760px) { .pr-two { grid-template-columns: 1fr; } }

/* Alarm Setup > Email & text */
.an-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 10px; }
.an-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; margin: 2px 6px 2px 0; border: 1px solid var(--line, #2a3441); border-radius: 999px; cursor: pointer; font-size: 14px; }
.an-chip.on { border-color: var(--accent, #3b82f6); background: var(--sel, rgba(59,130,246,.14)); }
.an-chip input { flex: none; width: 16px; height: 16px; min-width: 0; min-height: 0; margin: 0; }
.an-rule { border: 1px solid var(--line, #2a3441); border-radius: 10px; padding: 12px 14px; margin: 10px 0; background: var(--panel2, rgba(255,255,255,.03)); }
.an-rule.off { opacity: .6; }
.an-rh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.an-grid { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; align-items: start; font-size: 14px; }
.an-grid > b { color: var(--dim, #8aa0b6); font-weight: 600; padding-top: 7px; white-space: nowrap; }
.an-grid input:not([type]), .an-grid input[type="number"], .an-grid select { padding: 5px 8px; }
.an-pick { max-height: 180px; overflow: auto; border: 1px solid var(--line, #2a3441); border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
.an-pick label { display: flex; align-items: center; gap: 8px; padding: 3px 0; } .an-pick input { flex: none; width: 16px; height: 16px; min-width: 0; min-height: 0; margin: 0; }
.an-say { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: rgba(59,130,246,.10); font-size: 14px; }
.an-ok { color: #4ade80; font-weight: 600; } .an-ph input { padding: 5px 8px; } .an-sent td { vertical-align: top; } .an-sent .nowrap { white-space: nowrap; }
@media (max-width: 760px) { .an-grid { grid-template-columns: 1fr; } .an-grid > b { padding-top: 0; } }

/* an annual license in its week of grace: a strip every screen shows */
#licgrace { flex: none; padding: 6px 14px; background: #b45309; color: #fff; font-size: 14px; font-weight: 600; text-align: center; }

/* ---- Maintenance (public/js/cmms*.js): every status has a word as well as a colour, and controls are big enough for gloves */
.modal.cm-modal { width: min(1560px, 98vw); height: 95vh; max-height: 95vh; padding: 0; display: flex; overflow: hidden; }
.cm { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.cm-head { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex: none; }
.cm-head h3 { margin: 0; font-size: 20px; }
.cm-tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.cm-tab { height: 46px; padding: 0 16px; border: 0; border-radius: 10px; background: transparent; color: var(--text2); font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap; font-family: inherit; }
.cm-tab:hover { background: var(--panel2); } .cm-tab.on { background: var(--btn); color: #fff; }
.cm-body { flex: 1; overflow: auto; padding: 14px 16px 26px; min-height: 0; }
.cm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.cm-bar label { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 14px; }
.cm-sp { flex: 1; } .cm-grow { flex: 1; min-width: 200px; } .cm-grow input { flex: 1; }
.cm-tiles { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 0 0 14px; }
.cm-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: start; }
.cm-card { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.cm-card h4 { margin: 0 0 8px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--text2); }
.cm-card h5 { margin: 12px 0 6px; font-size: 13px; color: var(--text2); }
.cm-card.cm-alert { border-color: var(--fault); }
.cm-job { display: block; width: 100%; text-align: left; background: var(--panel2); border: 1px solid var(--line2); border-radius: 10px; color: var(--text); padding: 9px 12px; margin-bottom: 7px; cursor: pointer; font: inherit; }
.cm-job:hover { border-color: var(--accent); } .cm-job.urgent { border-left: 5px solid var(--fault); }
.cm-job-t { display: block; font-size: 15px; } .cm-job-m { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; margin-top: 4px; }
.cm-risk { display: block; color: var(--warn); font-size: 13px; margin-top: 3px; }
.cm-late { color: #fca5a5; font-weight: 700; }
.cm-pill, .cm-pri, .cm-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--sunk); border: 1px solid var(--line); color: var(--text2); white-space: nowrap; }
.cm-pill.st-inprogress { border-color: var(--run); color: #86efac; } .cm-pill.st-hold { border-color: var(--warn); color: #fcd34d; } .cm-pill.st-requested { border-color: var(--accent); color: var(--accent); } .cm-pill.st-closed, .cm-pill.st-cancelled { color: var(--dim); }
.cm-pri.p1 { background: var(--fault); border-color: var(--fault); color: #fff; } .cm-pri.p2 { border-color: var(--warn); color: #fcd34d; } .cm-pri.p4 { color: var(--dim); }
.cm-tag.warn { border-color: var(--warn); color: #fcd34d; }
.cm-crit { display: inline-block; min-width: 28px; text-align: center; border-radius: 6px; font-size: 12px; font-weight: 800; padding: 1px 4px; background: var(--sunk); border: 1px solid var(--line); color: var(--text2); }
.cm-crit.c4 { border-color: var(--warn); color: #fcd34d; } .cm-crit.c5 { background: var(--fault); border-color: var(--fault); color: #fff; }
.cm-note { background: var(--panel2); border-left: 4px solid var(--accent); padding: 8px 12px; border-radius: 6px; margin: 8px 0; } .cm-note.warn { border-left-color: var(--warn); }
.cm-pre { white-space: pre-wrap; margin: 8px 0; user-select: text; }
.cm-line { padding: 5px 0; border-bottom: 1px solid var(--line2); } .cm-line:last-child { border-bottom: 0; } .cm-draft { display: flex; align-items: center; gap: 8px; }
.cm-empty { padding: 20px 4px; }
.cm-filter { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; } .cm-filter label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--dim); } .cm-chk { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; font-size: 14px !important; color: var(--text) !important; cursor: pointer; }
.cm-chk input, .cm-sel input { width: 22px !important; height: 22px !important; }
.cm-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.cm-tw { overflow-x: auto; }
.cm-t { width: 100%; border-collapse: collapse; font-size: 14px; } .cm-t th { text-align: left; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; } .cm-t td { padding: 9px 8px; border-bottom: 1px solid var(--line2); vertical-align: top; } .cm-click { cursor: pointer; } .cm-click:hover td { background: var(--panel2); } .cm-t tr.urgent td:first-child { box-shadow: inset 4px 0 0 var(--fault); }
.cm-split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; } .cm-side { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 6px; max-height: 76vh; overflow: auto; }
.cm-tree { display: flex; gap: 8px; align-items: center; width: 100%; min-height: 44px; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; border-radius: 8px; font: inherit; padding: 4px 8px; } .cm-tree:hover { background: var(--panel2); } .cm-tree.on { background: var(--sel); }
.cm-ah { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 10px; } .cm-ah h3 { margin: 0; font-size: 22px; } .cm-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.cm-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; margin: 10px 0 14px; } .cm-facts small { display: block; color: var(--dim); font-size: 12px; word-break: break-all; } .cm-facts b { font-weight: 600; user-select: text; }
.cm-sub { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; } .cm-subb { height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text2); font-weight: 600; cursor: pointer; font: inherit; font-size: 14px; } .cm-subb.on { background: var(--sel); border-color: var(--accent); color: var(--text); }
/* forms */
.modal.cm-formm { max-width: 980px; } .modal.cm-formsm { max-width: 520px; }
.cm-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 14px; }
.cm-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; } .cm-f.full, h4.cm-f { grid-column: 1 / -1; } .cm-f label { font-size: 13px; color: var(--text2); } .cm-f small { font-weight: 400; }
h4.cm-f { margin: 10px 0 0; border-top: 1px solid var(--line2); padding-top: 10px; display: block; }
.cm-f input:not([type=checkbox]), .cm-f select, .cm-f textarea, .cm-c input:not([type=checkbox]), .cm-c select, .cm-paste, .cm-note-in, .cm-3 textarea { width: 100%; box-sizing: border-box; background: var(--input); border: 1px solid var(--line); border-radius: 9px; color: var(--text); padding: 9px 10px; font: inherit; font-size: 15px; user-select: text; }
.cm-inb { display: flex; gap: 6px; align-items: center; width: 100%; } .cm-inb input { flex: 1; min-width: 0; }
.cm-f > .eb { align-self: flex-start; }
.cm-rowsh { font-size: 13px; color: var(--text2); margin-bottom: 4px; } .cm-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.cm-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; padding: 8px; }
.cm-c { display: flex; flex-direction: column; gap: 2px; flex: 1 1 96px; min-width: 80px; } .cm-c small { color: var(--dim); font-size: 11px; } .cm-c.w2 { flex: 2 1 170px; } .cm-c.w3 { flex: 3 1 240px; } .cm-c.cm-cb { flex: 0 0 auto; min-width: 62px; align-items: center; } .cm-c.cm-cb input { width: 22px; height: 22px; margin: 8px 0; } .cm-rowx { display: flex; gap: 4px; }
.cm-set { padding: 7px 0; flex-wrap: wrap; } .cm-set small { display: block; width: 100%; margin-left: 30px; } .cm-set2 { display: block; padding: 7px 0; } .cm-set2 input { width: 110px; margin: 0 8px; background: var(--input); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 8px; font: inherit; } .cm-set2 small { display: block; }
.cm-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; } .cm-3 label { font-size: 13px; color: var(--text2); }
/* one work order */
.modal.cm-womodal { width: min(1320px, 97vw); height: 94vh; max-height: 94vh; }
.cm-wosub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; } .cm-woacts { flex-wrap: wrap; margin: 10px 0; justify-content: flex-start; }
.cm-prog { height: 8px; background: var(--sunk); border-radius: 4px; overflow: hidden; } .cm-prog i { display: block; height: 100%; background: var(--run); }
.cm-step { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; border-bottom: 1px solid var(--line2); padding: 10px 2px; } .cm-step:last-child { border-bottom: 0; } .cm-step.ok .cm-step-t { color: var(--text2); } .cm-step-c { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; max-width: 460px; }
.cm-step.lockout, .cm-step.release { border-left: 4px solid var(--warn); padding-left: 10px; } .cm-step.prooftest { border-left: 4px solid var(--accent); padding-left: 10px; }
.cm-do { min-height: 48px; min-width: 76px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; } .cm-do.on { background: var(--run); border-color: var(--run); color: #04210f; } .cm-do.fail.on { background: var(--fault); border-color: var(--fault); color: #fff; }
.cm-num { width: 110px; height: 48px; background: var(--input); border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 0 10px; font: inherit; font-size: 18px; } .cm-txt { width: 280px; max-width: 100%; height: 48px; background: var(--input); border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 0 10px; font: inherit; }
.cm-pass { color: #86efac; font-weight: 700; font-size: 13px; } .cm-fail { color: #fca5a5; font-weight: 700; font-size: 13px; } .cm-val { font-weight: 600; }
.cm-photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; } .cm-photos figure { margin: 0; width: 150px; } .cm-photos img { width: 150px; height: 112px; object-fit: cover; border-radius: 8px; background: var(--sunk); }
.cm-evs { margin-top: 10px; } .cm-ev { padding: 5px 0; border-top: 1px solid var(--line2); font-size: 14px; user-select: text; } .cm-ev .small { display: block; }
/* schedule */
.cm-sched { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 10px; align-items: start; } .cm-unsch { background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; padding: 8px; max-height: 70vh; overflow: auto; } .cm-unsch h4 { margin: 0 0 6px; font-size: 13px; }
.cm-wk { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 860px; } .cm-wk th { font-size: 12px; color: var(--dim); padding: 4px; text-align: left; } .cm-wk td { border: 1px solid var(--line2); vertical-align: top; padding: 4px; height: 66px; font-size: 13px; } .cm-wk th:first-child, .cm-wk td:first-child { width: 150px; }
.cm-card2 { background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 7px; padding: 5px 7px; margin-bottom: 4px; font-size: 13px; cursor: grab; } .cm-card2.p1 { border-left-color: var(--fault); } .cm-card2.p2 { border-left-color: var(--warn); } .cm-card2 small { display: block; }
.cm-heat { height: 7px; background: var(--sunk); border-radius: 4px; overflow: hidden; margin-top: 4px; } .cm-heat i { display: block; height: 100%; background: var(--accent); } .cm-heat.full i { background: var(--warn); } .cm-heat.over i { background: var(--fault); } .cm-heat.wide { min-width: 200px; }
.cm-year { border-collapse: collapse; font-size: 12px; } .cm-year th { font-weight: 400; color: var(--dim); padding: 2px; white-space: nowrap; text-align: left; } .cm-year td { border: 1px solid var(--line2); min-width: 15px; height: 22px; text-align: center; padding: 0; } .cm-year td:first-child { min-width: 200px; text-align: left; padding: 0 8px; white-space: nowrap; } .cm-year td.on { background: var(--sel); color: var(--accent); }
/* wall graphics */
.w-cmms { width: 100%; height: 100%; display: flex; flex-direction: column; gap: 8px; padding: 10px; box-sizing: border-box; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: var(--text); overflow: hidden; } .w-cmms h4 { margin: 0; font-size: 14px; letter-spacing: .06em; color: var(--text2); text-transform: uppercase; }
.w-cmms-g { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; } .w-cmms-g div { background: var(--panel2); border-radius: 8px; padding: 6px 10px; display: flex; flex-direction: column; justify-content: center; } .w-cmms-g small { color: var(--dim); font-size: 12px; } .w-cmms-g b { font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; } .w-cmms-g b.bad { color: #fca5a5; }
body.phone .modal.cm-modal, body.phone .modal.cm-womodal { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
@media (max-width: 900px) {
  .cm-cols, .cm-split, .cm-sched, .cm-step { grid-template-columns: minmax(0, 1fr); } .cm-step-c { justify-content: flex-start; max-width: none; } .cm-side { max-height: 240px; } .cm-3 { grid-template-columns: 1fr; } .cm-head { flex-wrap: wrap; } .cm-tabs { order: 3; flex-basis: 100%; } .cm-head h3 { flex: 1; } .cm-form { grid-template-columns: minmax(0, 1fr); }
  .cm-t thead { display: none; } .cm-t, .cm-t tbody, .cm-t tr, .cm-t td { display: block; width: 100%; box-sizing: border-box; } .cm-t tr { background: var(--panel2); border: 1px solid var(--line2); border-radius: 10px; padding: 6px 10px; margin-bottom: 8px; } .cm-t td { border: 0; padding: 3px 0; } .cm-t td[data-l]:not([data-l=""]):not([data-l="Job"]):not([data-l="Part"]):not([data-l="Plan"])::before { content: attr(data-l) ": "; color: var(--dim); font-size: 12px; } .cm-t td:empty { display: none; }
}

/* badges for one person (Users & permissions) */
.bdg-list { display: flex; flex-direction: column; gap: 6px; }
.bdg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line, #2c3a4a); border-radius: 8px; }
.bdg-wait { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding: 12px; border: 1px dashed var(--line, #2c3a4a); border-radius: 8px; }

/* company sign-in */
.g-ms { margin-top: 8px; padding: 11px; border-radius: 8px; border: 1px solid var(--line, #2c3a4a); background: #fff; color: #1b1b1b; font-weight: 600; cursor: pointer; width: 100%; }
.dir-card { border: 1px solid var(--line, #2c3a4a); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.dir-grid { display: grid; grid-template-columns: 200px 1fr; gap: 8px 12px; align-items: start; }
.dir-grid input, .dir-grid textarea, .dir-grid select { width: 100%; box-sizing: border-box; }
.dir-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; } .dir-row input { flex: 1; min-width: 0; } .dir-row select { width: 190px; flex: none; }
@media (max-width: 700px) { .dir-grid { grid-template-columns: 1fr; } }

/* "Johnny only" logins: a full-page Johnny over everything else (modals, toasts and the view-as banner stay above it) */
#jnfull { display: none; }
body.jn-only #jnfull { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; background: var(--bg); }
body.jn-only #viewas ~ #jnfull { top: 42px; }
.jnf-h { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--panel); font-size: 15px; }
.jnf-h .jnf-who { flex: 1; color: var(--dim); }
.jnf-body { flex: 1; min-height: 0; display: flex; justify-content: center; }
.jnf-body > .jn { flex: 1; max-width: 1100px; width: 100%; }
.jnf-body > .jn-away { margin: auto; max-width: 520px; padding: 24px; text-align: center; }
body.jn-only .jn-h [data-jn="pop"], body.jn-only .jn-h [data-jn="min"], body.jn-only .jn-h [data-jn="close"] { display: none; }
body.jn-only #jnwin, body.jn-only #jnbubble { display: none !important; }
/* a read-only site: what the assistant was not allowed to do, said under the answer */
.jn-ro { margin: 8px 0 0; padding: 6px 10px; border-left: 3px solid #f59e0b; background: var(--sunk); border-radius: 6px; font-size: 13px; }
