@font-face { font-family: 'Neo Sans Pro'; src: url('assets/fonts/NeoSansPro-Regular.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; ascent-override: 94%; descent-override: 21%; line-gap-override: 0%; }
@font-face { font-family: 'Neo Sans Pro'; src: url('assets/fonts/NeoSansPro-Medium.otf') format('opentype'); font-weight: 500; font-style: normal; font-display: swap; ascent-override: 94%; descent-override: 21%; line-gap-override: 0%; }
@font-face { font-family: 'Neo Sans Pro'; src: url('assets/fonts/NeoSansPro-Bold.otf') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; ascent-override: 94%; descent-override: 21%; line-gap-override: 0%; }
@font-face { font-family: 'Neo Sans Pro'; src: url('assets/fonts/NeoSansPro-Italic.otf') format('opentype'); font-weight: 400; font-style: italic; font-display: swap; ascent-override: 94%; descent-override: 21%; line-gap-override: 0%; }
@font-face { font-family: 'Neo Sans Pro'; src: url('assets/fonts/NeoSansPro-MediumItalic.otf') format('opentype'); font-weight: 500; font-style: italic; font-display: swap; ascent-override: 94%; descent-override: 21%; line-gap-override: 0%; }
@font-face { font-family: 'Neo Sans Pro'; src: url('assets/fonts/NeoSansPro-BoldItalic.otf') format('opentype'); font-weight: 700; font-style: italic; font-display: swap; ascent-override: 94%; descent-override: 21%; line-gap-override: 0%; }
@font-face {
  font-family: 'neo-sans-std';
  src: url('assets/neo-sans-std.otf');
}

:root {
  --rail-w: 68px;
  --rail-w-open: 252px;
  --top-h: 64px;
  --bg: #1e1e1e;
  --bg-2: #2d2d2d;
  --card: #111;
  --line: #3a3a3a;
  --text: #e9e9e9;
  --muted: #9a9a9a;
  --blue: #2456a0;
  --green: #5cb85c;
  --red: #e5534b;
  --orange: #f0a030;
  --accent: #fff;
  font-family: 'Neo Sans Pro', 'neo-sans-std', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: #000; color: var(--text); font-size: 14px; overflow: hidden; }
button { font: inherit; color: inherit; }
svg.ico { display: block; flex: none; }

/* ───────────── Shell ───────────── */
.shell { display: flex; height: 100vh; }
.rail {
  width: var(--rail-w); flex: none; background: #0b0b0b; border-right: 1px solid #1d1d1d;
  display: flex; flex-direction: column; transition: width .22s cubic-bezier(.3,.7,.3,1); z-index: 5;
}
.shell.open .rail { width: var(--rail-w-open); }
.rail-top { height: var(--top-h); flex: none; display: flex; align-items: center; padding-left: 14px; border-bottom: 1px solid #1d1d1d; }
.rail-toggle {
  width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: #8d8d8d; cursor: pointer;
  display: grid; place-items: center;
}
.rail-toggle:hover { background: #1c1c1c; color: #fff; }
.rail-list { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 0 14px; scrollbar-width: none; display: flex; flex-direction: column; }
.rail-list::-webkit-scrollbar { display: none; }
.rail-sep { height: 1px; background: #1f1f1f; margin: 8px 14px; flex: none; }
.rail-spacer { flex: 1; min-height: 8px; }

.sb-item {
  position: relative; height: 52px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 14px;
  cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; outline: none;
  transition: background .15s;
}
.sb-item .ico { width: 40px; height: 40px; transition: transform .18s, opacity .2s, filter .2s, box-shadow .2s; border-radius: 10px; }
.sb-item .lbl {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #bdbdbd; font-size: 15px; opacity: 0;
  transition: opacity .15s; pointer-events: none;
}
.shell.open .sb-item .lbl { opacity: 1; transition-delay: .06s; }
.sb-item:hover { background: rgba(255,255,255,.045); }
.sb-item:hover .lbl { color: #fff; }
.sb-item:focus-visible { box-shadow: inset 0 0 0 2px #2456a0; }
.sb-item.pressing .ico { transform: scale(.92); }
.sb-item.placeholder { opacity: .18; }
.sb-item.placeholder.collapse { height: 0; opacity: 0; transition: height .18s, opacity .1s; }
.sb-item.pop-in .ico { animation: popIn .55s cubic-bezier(.2,1.4,.4,1); }
@keyframes popIn {
  0% { transform: scale(.3); opacity: 0; }
  60% { transform: scale(1.12); opacity: 1; box-shadow: 0 0 0 6px rgba(255,255,255,.18); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}
.sb-item .badge {
  position: absolute; left: 44px; top: 7px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #e9e9e9; color: #111; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700;
  border: 2px solid #0b0b0b;
}

/* Active highlight — style A: accent bar + soft well (default) */
.hl-bar .sb-item.active { background: rgba(255,255,255,.085); }
.hl-bar .sb-item.active::before {
  content: ''; position: absolute; left: 0; top: 11px; bottom: 11px; width: 4px; border-radius: 0 4px 4px 0;
  background: var(--accent); box-shadow: 0 0 12px var(--accent);
}
.hl-bar .sb-item.active .lbl, .hl-ring .sb-item.active .lbl, .hl-dim .sb-item.active .lbl { color: #fff; }
/* style B: halo ring around the icon */
.hl-ring .sb-item.active .ico { box-shadow: 0 0 0 2.5px #0b0b0b, 0 0 0 5px var(--accent), 0 0 18px 2px color-mix(in srgb, var(--accent) 50%, transparent); }
.hl-ring .sb-item.active { background: rgba(255,255,255,.03); }
/* style C: dim everything else */
.hl-dim .sb-item:not(.active) .ico { opacity: .42; filter: saturate(.35); }
.hl-dim .sb-item:not(.active):hover .ico { opacity: .85; filter: none; }
.hl-dim .sb-item.active { background: rgba(255,255,255,.07); }
.hl-dim .sb-item.active .ico { transform: scale(1.06); }

/* Drag ghost */
.sb-ghost {
  position: fixed; z-index: 100; pointer-events: none; display: flex; align-items: center; gap: 14px; padding: 0 14px; height: 52px;
  background: rgba(30,30,30,.92); border-radius: 12px; box-shadow: 0 14px 34px rgba(0,0,0,.6), 0 0 0 1px #333;
  transition: background .15s, opacity .15s; will-change: transform;
}
.sb-ghost .lbl { color: #fff; font-size: 15px; white-space: nowrap; }
.sb-ghost .ico { width: 40px; height: 40px; transform: scale(1.06); transition: transform .15s; }
.sb-ghost .rm-hint {
  display: none; position: absolute; left: 50px; top: -26px; white-space: nowrap; font-size: 12px; background: #c63c3c;
  color: #fff; padding: 3px 9px; border-radius: 10px;
}
.sb-ghost.to-remove { background: rgba(80,20,20,.85); }
.sb-ghost.to-remove .ico { transform: scale(.85) rotate(-6deg); opacity: .75; }
.sb-ghost.to-remove .rm-hint { display: block; }
.sb-ghost.no-remove .rm-hint { display: block; background: #444; }
.sb-ghost.poof { transition: transform .25s, opacity .25s; opacity: 0; }
.sb-ghost.snap { transition: transform .2s cubic-bezier(.3,.7,.3,1); }
body.dragging, body.dragging * { cursor: grabbing !important; }

/* Tooltip */
.tip {
  position: fixed; z-index: 90; pointer-events: none; background: #000; color: #fff; border: 1px solid #3a3a3a;
  padding: 7px 14px; border-radius: 18px; font-size: 15px; white-space: nowrap; opacity: 0; transform: translateX(-4px);
  transition: opacity .12s, transform .12s; box-shadow: 0 6px 18px rgba(0,0,0,.5);
}
.tip.show { opacity: 1; transform: none; }
.tip small { color: #8d8d8d; margin-left: 8px; font-size: 12px; }

/* Context menu */
.ctx {
  position: fixed; z-index: 95; min-width: 220px; background: #1a1a1a; border: 1px solid #353535; border-radius: 12px; padding: 6px;
  box-shadow: 0 16px 40px rgba(0,0,0,.6); display: none;
}
.ctx.show { display: block; animation: menuIn .12s ease-out; }
@keyframes menuIn { from { opacity: 0; transform: scale(.97) translateY(-3px); } }
.ctx-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; border-bottom: 1px solid #2c2c2c; margin-bottom: 4px; }
.ctx-head b { font-weight: 500; font-size: 15px; }
.ctx-head small { display: block; color: var(--muted); font-size: 12px; }
.ctx button {
  display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 8px 10px;
  border-radius: 7px; cursor: pointer; font-size: 14px; color: #ddd;
}
.ctx button:hover:not(:disabled) { background: #2b2b2b; color: #fff; }
.ctx button:disabled { color: #666; cursor: default; }
.ctx button .k { margin-left: auto; color: #777; font-size: 12px; }
.ctx button.danger { color: #ff8a80; }
.ctx button.danger:hover { background: #3a1c1c; }
.ctx hr { border: 0; border-top: 1px solid #2c2c2c; margin: 4px 0; }
.ctx svg { width: 16px; height: 16px; flex: none; opacity: .8; }

/* Overflow / hidden-apps popover */
.pop {
  position: fixed; z-index: 92; width: 280px; background: #1a1a1a; border: 1px solid #353535; border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0,0,0,.65); display: none; overflow: hidden;
}
.pop.show { display: block; animation: menuIn .14s ease-out; }
.pop h4 { margin: 0; padding: 12px 14px 10px; font-weight: 500; font-size: 13px; color: var(--muted); letter-spacing: .02em; display: flex; justify-content: space-between; }
.pop-list { padding: 0 6px 6px; max-height: 60vh; overflow: auto; }
.pop-row { display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 9px; cursor: pointer; }
.pop-row:hover { background: #262626; }
.pop-row.current { background: #2a2a2a; box-shadow: inset 3px 0 0 var(--accent); }
.pop-row .t { flex: 1; min-width: 0; }
.pop-row .t b { font-weight: 400; display: block; font-size: 14px; color: #eee; }
.pop-row .t small { color: #888; font-size: 12px; }
.pin-btn {
  border: 1px solid #3c3c3c; background: #222; color: #bbb; border-radius: 8px; height: 28px; padding: 0 9px; cursor: pointer; font-size: 12px;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.pin-btn:hover { background: #333; color: #fff; }
.pop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 2px 8px 8px; }
.pop-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; border-radius: 10px; cursor: pointer; text-align: center; position: relative; }
.pop-tile:hover { background: #262626; }
.pop-tile.current { background: #2a2a2a; }
.pop-tile span { font-size: 12px; color: #ccc; line-height: 1.2; }
.pop-tile .mini-pin { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 6px; border: 0; background: #333; color: #ddd; display: none; cursor: pointer; font-size: 13px; line-height: 22px; padding: 0; }
.pop-tile:hover .mini-pin { display: block; }
.pop-foot { border-top: 1px solid #2c2c2c; padding: 10px 14px; font-size: 13px; color: #7fb6ff; cursor: pointer; }
.pop-foot:hover { background: #222; }
.pop-empty { padding: 4px 16px 14px; color: #888; font-size: 13px; }

/* Toasts */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; background: #f1f1f1; color: #161616; border-radius: 12px; padding: 10px 12px 10px 14px; display: flex; gap: 12px; align-items: center;
  box-shadow: 0 12px 30px rgba(0,0,0,.5); font-size: 14px; animation: toastIn .2s ease-out; max-width: 560px;
}
.toast .ico { width: 26px; height: 26px; }
.toast button { border: 0; background: #1d1d1d; color: #fff; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.toast button.ghost { background: transparent; color: #2456a0; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .2s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ───────────── Header ───────────── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--top-h); flex: none; background: linear-gradient(90deg, rgba(11, 11, 11, 1) 0%, rgba(11, 11, 11, 1) 50%, rgba(34, 80, 146, 1) calc(100% - 1px), #0b0b0b calc(100% - 1px), #0b0b0b 100%); border-bottom: 1px solid #1d1d1d; display: flex; align-items: center; padding: 0 28px 0 26px; gap: 16px; }
.page-title { margin: 0; font-weight: 400; font-size: 30px; letter-spacing: .01em; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { height: 21px; margin-left: auto; opacity: .95; }
.content { flex: 1; min-height: 0; overflow: auto; background: var(--bg); position: relative; }
.page { min-height: 100%; display: flex; flex-direction: column; animation: pageIn .18s ease-out; }
@keyframes pageIn { from { opacity: .4; } }

/* ───────────── Shared bits ───────────── */
.gear-s { width: 13px; height: 13px; display: inline-block; vertical-align: -1px; margin-left: 6px; opacity: .9; }
.btn-g { background: #4a4a4a; border: 0; color: #eee; height: 30px; padding: 0 22px; border-radius: 3px; cursor: pointer; font-size: 15px; }
.btn-g:hover { background: #575757; }
.footer { height: 30px; flex: none; display: flex; align-items: center; padding: 0 10px; background: #181818; color: #bbb; font-size: 13px; gap: 10px; border-top: 1px solid #2a2a2a; }
.footer .r { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.footer .sup { color: #f0b429; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot.g { background: #4cba52; } .dot.r { background: #e5534b; } .dot.y { background: #f0b429; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #555; border-top-color: #ddd; animation: rot .7s linear infinite; display: inline-block; vertical-align: -2px; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ───────────── Reactor: Panels & Devices ───────────── */
.r-subbar { height: 44px; display: flex; align-items: center; padding: 0 12px; background: #2b2b2b; gap: 8px; font-size: 16px; flex: none; }
.r-subbar .sp { flex: 1; }
.r-viewtg { display: flex; margin-left: 12px; }
.r-viewtg button { width: 40px; height: 30px; background: #3a3a3a; border: 0; cursor: pointer; color: #ddd; display: grid; place-items: center; }
.r-viewtg button.on { background: #555; }
.r-split { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 6px minmax(300px, 600px); }
.r-split > .div { background: #1f1f1f; }
.r-tabs { height: 30px; border-bottom: 1px solid #444; display: flex; align-items: flex-end; }
.r-tab { background: #555; color: #eee; padding: 5px 14px; font-size: 15px; border-radius: 4px 4px 0 0; min-width: 160px; }
.r-tab.wide { min-width: 266px; }
.r-left-in { margin: 16px 8px; background: #333; padding: 16px 16px 24px; border-radius: 3px; }
.p-card { background: #0d0d0d; border-radius: 3px; padding: 22px 14px; display: grid; grid-template-columns: 260px 70px minmax(0, 1fr); gap: 0; margin-bottom: 16px; }
.p-card h5 { margin: 0 0 14px; font-weight: 400; font-size: 16px; }
.p-card .pid { font-size: 16px; margin-bottom: 14px; }
.p-card .st { font-size: 13px; color: #e5534b; }
.p-card .st.ok { color: #5cb85c; } .p-card .st.warn { color: #f0a030; }
.p-thumb { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.bulb { width: 26px; height: 26px; border-radius: 50%; background: #ccc; display: grid; place-items: center; }
.bulb svg { width: 14px; height: 14px; }
.dd { border: 1px solid #bbb; border-radius: 3px; height: 37px; max-width: 824px; display: flex; align-items: center; padding: 0 18px; gap: 8px; font-size: 16px; }
.dd .chip { background: #3c4a5c; color: #dfe9f7; font-size: 13px; padding: 2px 5px; border-radius: 3px; }
.dd .caret { margin-left: auto; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 7px solid #ddd; }
.info-i { width: 18px; height: 18px; border: 1.5px solid #ddd; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-style: italic; }
.p-hint { font-style: italic; font-size: 16px; margin-top: 18px; line-height: 1.5; }
.p-hint b { font-weight: 700; }

.dev-wrap { padding: 16px 8px 16px 12px; }
.warnbox { background: #2f2f2f; padding: 20px 26px 26px; font-size: 16px; }
.warnbox .head { text-align: center; margin-bottom: 26px; position: relative; }
.warnbox .head::after { content: '⌃'; position: absolute; right: 0; top: 2px; color: #ccc; }
.warnbox .row { display: flex; gap: 12px; line-height: 1.55; }
.tri { width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-bottom: 21px solid #f0b429; position: relative; flex: none; margin-top: 2px; display: inline-block; vertical-align: -4px; margin-right: 4px; }
.tri::after { content: '!'; position: absolute; left: -2px; top: 4px; color: #222; font-weight: 700; font-size: 13px; }
.dev-group { margin: 16px 0 10px; font-size: 16px; }
.dev-card { background: #0d0d0d; padding: 14px 12px; display: flex; justify-content: space-between; font-size: 16px; border-radius: 3px; }
.dev-card .l > div { margin-bottom: 8px; }
.dev-card .st { color: #e5534b; font-size: 13px; }
.dev-img { width: 106px; height: 106px; background: #1c1c1c; border: 1px solid #333; display: grid; place-items: center; }
.dev-img i { width: 84px; height: 30px; background: #333; border-radius: 3px; display: block; position: relative; box-shadow: inset 0 0 0 1px #555; }
.dev-img i::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: 6px; height: 4px; background: repeating-linear-gradient(90deg, #ddd 0 6px, transparent 6px 10px); }
.orange-box { border: 1px solid #f0a030; background: #3a2c17; color: #f0a030; padding: 12px 18px; display: flex; gap: 14px; line-height: 1.5; font-size: 16px; border-radius: 3px; }
.orange-box .ex { width: 24px; height: 24px; border-radius: 50%; background: #f0a030; color: #3a2c17; display: grid; place-items: center; font-weight: 700; flex: none; margin-top: 2px; }

/* ───────────── Reactor: Editor / Simulation ───────────── */
.cfg { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 8px 590px; min-height: 0; }
.cfg.sim { grid-template-columns: 1fr; }
.cfg > .div { background: #1b1b1b; }
.cfg-left { display: flex; flex-direction: column; min-height: 0; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; flex-wrap: wrap; }
.tb-ico { width: 30px; height: 30px; display: grid; place-items: center; color: #5fb6a0; }
.chipbtn { height: 32px; background: #2456a0; color: #fff; font-size: 13px; letter-spacing: .08em; padding: 0 14px; display: inline-flex; align-items: center; gap: 12px; border-radius: 2px; }
.chipbtn.sel { box-shadow: inset 0 -3px 0 #a2e86b; }
.chipbtn.fit { background: #2b8a6e; }
.chipbtn svg { width: 16px; height: 16px; }
.tb-right { margin-left: auto; display: flex; gap: 18px; color: #4a9be8; align-items: center; font-size: 22px; }
.tb-right .g { color: #aaa; }
.optrow { display: flex; align-items: center; gap: 12px; padding: 4px 16px 10px; font-size: 16px; flex-wrap: wrap; }
.optrow .sel { background: #111; padding: 7px 10px; min-width: 150px; display: inline-flex; justify-content: space-between; gap: 30px; }
.seg { display: inline-flex; background: #3a3a3a; border-radius: 10px; overflow: hidden; }
.seg span { padding: 2px 8px; color: #888; } .seg span.on { background: #555; color: #eee; }
.canvas-wrap { flex: 1; position: relative; overflow: hidden; min-height: 500px; }
.canvas {
  position: absolute; left: 175px; top: 140px; right: 0; bottom: 0; border-top: 1px solid #555; border-left: 1px solid #555;
  background-color: #2a2a2a;
  background-image: linear-gradient(#333 1px, transparent 1px), linear-gradient(90deg, #333 1px, transparent 1px);
  background-size: 12px 12px;
}
.sim .canvas { left: 50px; top: 60px; }
.hw { position: absolute; }
.hw-pill { width: 340px; height: 200px; border-radius: 28px; background: linear-gradient(180deg, #7db6ec, #4a8fd4); box-shadow: inset 0 -6px 12px rgba(0,0,0,.25), 0 2px 0 #2b6bb0; }
.hw-pill .scr { position: absolute; left: 110px; top: 26px; width: 120px; height: 150px; background: #777; border-radius: 3px; opacity: .8; color: #eee; font-size: 14px; padding: 8px; }
.hw-pill .led { position: absolute; right: 24px; top: 20px; width: 70px; height: 20px; border-radius: 4px; background: #9cc9f2; }
.hw-panel { background: #333; border: 3px solid #111; border-radius: 6px; padding: 8px; display: grid; gap: 6px; }
.hw-panel .k { background: #444; border-radius: 4px; box-shadow: inset 0 0 0 1px #555; display: grid; place-items: center; }
.hw-panel .k i { width: 60%; height: 50%; background: #222; display: block; border-radius: 2px; }
.hw-panel .b { background: #7a7a7a; border-radius: 3px; display: grid; place-items: center; }
.hw-panel .b i { width: 55%; height: 80%; background: #636363; border-radius: 4px; display: block; }
.knob { border-radius: 50%; background: #6d6d6d; box-shadow: inset 0 0 0 3px #555, 0 0 0 2px #2a2a2a; display: grid; place-items: center; }
.knob i { width: 34%; height: 34%; border-radius: 50%; background: #5a5a5a; display: block; }
.hw-blue { background: linear-gradient(180deg, #4c95dc, #2d73c0); border: 3px solid #1a1a1a; border-radius: 6px; padding: 14px; }
.hw-blue .rowk { display: flex; gap: 12px; margin-bottom: 10px; }
.hw-blue .oled { width: 42px; height: 22px; background: #0a0a0a; border-radius: 2px; }
.hw-blue .bt { width: 46px; height: 32px; background: #c9c4ba; border-radius: 4px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.hw-blue .bt.gr { background: #59d3a3; } .hw-blue .bt.lime { background: #8bf24a; } .hw-blue .bt.lb { background: #8eb0f0; } .hw-blue .bt.cy { background: #8fe0e3; } .hw-blue .bt.wh { background: #f4f4f4; }
.inspector { padding: 0 0 0 0; }
.inspector h3 { font-weight: 500; font-size: 20px; margin: 30px 12px; }

/* ───────────── Settings ───────────── */
.set-grid { padding: 30px 30px 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.panel { background: #2f2f2f; border-radius: 4px; overflow: hidden; }
.panel > h3 { margin: 0; font-weight: 400; font-size: 21px; padding: 14px 16px; border-bottom: 1px solid #3c3c3c; display: flex; justify-content: space-between; align-items: center; }
.panel .pb { padding: 16px; }
table.st { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 16px; }
table.st th { background: #111; font-weight: 400; font-size: 12px; padding: 9px; }
table.st td { text-align: center; padding: 7px; border-bottom: 1px solid #2b2b2b; background: #262626; }
.btnrow { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.bb { border: 0; border-radius: 2px; height: 32px; padding: 0 30px; color: #fff; font-size: 16px; cursor: pointer; background: #2456a0; display: inline-flex; gap: 8px; align-items: center; }
.bb.green { background: #5cb85c; } .bb.orange { background: #f0a030; }
.logsel { background: #111; padding: 10px 18px; margin-bottom: 14px; display: flex; justify-content: space-between; font-size: 16px; }
.logs { background: #111; font-family: inherit; font-size: 14px; line-height: 1.38; padding: 10px; height: 520px; overflow: auto; color: #ddd; word-break: break-all; margin-bottom: 14px; }
.logs .a1 { color: #2ab3c0; } .logs .a2 { color: #d0569f; } .logs .a3 { color: #57b06a; } .logs .er { color: #e5534b; }
.tabs2 { display: flex; background: #3a3a3a; }
.tabs2 span { padding: 16px 20px; color: #ddd; } .tabs2 span.on { color: #2456a0; box-shadow: inset 0 -2px 0 #2456a0; }
.frow { display: flex; align-items: center; padding: 14px 0; font-size: 16px; }
.frow .l { width: 280px; }
.tg { width: 44px; height: 22px; border-radius: 11px; background: #555; position: relative; display: inline-block; flex: none; cursor: pointer; }
.tg::after { content: ''; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #d8c8ea; transition: .15s; }
.tg.on { background: #2456a0; } .tg.on::after { left: 24px; background: #2456a0; box-shadow: 0 0 0 2px #2456a0; }
.note { color: #aaa; line-height: 1.55; font-size: 15px; }
.yellow-box { border: 1px solid #f0b429; color: #f0b429; padding: 10px 18px; background: #3a3220; margin-top: 18px; font-size: 16px; }

/* ───────────── Apps & Packages (new design, after Image 7) ───────────── */
.pk { padding: 28px 28px 50px; display: grid; grid-template-columns: var(--sx-nav-w, 264px) 24px minmax(0, 1fr); gap: 0; align-items: start; }
.pk > .sx-gutter { align-self: stretch; }
@media (max-width: 1150px) { .pk { grid-template-columns: 1fr; row-gap: 24px; } .pk-nav { position: static; } .pk > .sx-gutter { display: none; } }
.pk-nav { background: #2c2c2c; border-radius: 8px; padding: 20px 16px 30px; position: sticky; top: 34px; }
.pk-nav .net { text-align: right; color: #999; font-size: 15px; padding-bottom: 14px; border-bottom: 1px solid #444; margin-bottom: 14px; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.pk-nav a { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; font-size: 20px; color: #e8e8e8; text-decoration: none; border-radius: 6px; margin-bottom: 6px; cursor: pointer; }
.pk-nav a:hover { background: #333; }
.pk-nav a.on { background: #151515; color: #2456a0; }
.pk-nav a .cnt { font-size: 13px; color: #888; }
.pk-main { background: #2c2c2c; border-radius: 8px; padding: 34px 28px 36px; min-width: 0; }
.tblwrap { overflow-x: auto; }
.pk-main h2 { margin: 0 0 34px; font-weight: 500; font-size: 32px; }
.pk-tools { display: flex; gap: 34px; align-items: center; padding-bottom: 36px; border-bottom: 1px solid #4a4a4a; margin-bottom: 30px; flex-wrap: wrap; }
.srch { background: #111; height: 36px; width: 240px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 2px; }
.srch input { flex: 1; background: none; border: 0; outline: none; color: #eee; font: inherit; font-size: 15px; min-width: 0; }
.lbtn { background: #e3e3e3; color: #2456a0; border: 0; border-radius: 3px; height: 36px; padding: 0 36px; font-size: 16px; cursor: pointer; white-space: nowrap; }
.lbtn:hover { background: #fff; }
.lbtn.sm { height: 32px; padding: 0 20px; font-size: 15px; }
.lbtn.pri { background: #2456a0; color: #fff; }
.lbtn.pri:hover { background: #5a9cff; }
.lbtn.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(61,139,253,.3); } }
.lbtn:disabled { opacity: .5; cursor: default; }
.pk-sec { margin-bottom: 40px; }
.pk-sec > h3 { font-weight: 400; font-size: 21px; margin: 0 0 8px; display: flex; align-items: baseline; gap: 14px; }
.pk-sec > h3 small { color: #8a8a8a; font-size: 14px; }
.pk-sec > p.sub { margin: 0 0 18px; color: #8f8f8f; font-size: 14px; }
.launch { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ltile {
  background: #232323; border: 1px solid #353535; border-radius: 12px; padding: 18px 12px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; position: relative; transition: background .15s, transform .15s, border-color .15s; text-align: center;
}
.ltile:hover { background: #2a2a2a; border-color: #4a4a4a; transform: translateY(-2px); }
.ltile.cur { border-color: #6a6a6a; }
.ltile .nm { font-size: 15px; color: #f0f0f0; line-height: 1.2; }
.ltile .ap { font-size: 12px; color: #888; margin-top: -6px; }
.ltile .pin {
  margin-top: 4px; border: 1px solid #3c3c3c; background: #1b1b1b; color: #aaa; border-radius: 14px; font-size: 12px; padding: 4px 10px; cursor: pointer;
  display: inline-flex; gap: 6px; align-items: center;
}
.ltile .pin.on { color: #cfe3ff; border-color: #2f5fa8; background: #172741; }
.ltile .pin:hover { filter: brightness(1.25); }
.ltile.hidden-tile .ico { opacity: .55; }
table.pt { width: 100%; border-collapse: collapse; font-size: 15px; }
table.pt th { text-align: left; font-weight: 400; color: #9a9a9a; padding: 0 10px 10px; border-bottom: 1px solid #4a4a4a; font-size: 15px; white-space: nowrap; }
table.pt td { padding: 10px; vertical-align: middle; border-bottom: 1px solid #333; }
table.pt tr.flash td { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: rgba(61,139,253,.22); } }
.nm-cell { display: flex; gap: 14px; align-items: center; }
.nm-cell .ico { width: 36px; height: 36px; }
.nm-cell > div { min-width: 220px; }
.nm-cell b { font-weight: 400; font-size: 16px; display: block; }
.nm-cell small { color: #8d8d8d; font-size: 14px; }
.nm-cell .noui { width: 36px; height: 36px; flex: none; }
.ver { background: #111; padding: 6px 10px; display: inline-flex; gap: 14px; align-items: center; font-size: 15px; white-space: nowrap; }
.ver::after { content: ''; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid #ccc; }
.icbtn { width: 34px; height: 34px; display: inline-grid; place-items: center; background: none; border: 0; color: #cfcfcf; cursor: pointer; border-radius: 6px; }
.icbtn:hover { background: #3a3a3a; color: #fff; }
.icbtn:disabled { opacity: .3; cursor: default; background: none; }
.icbtn svg { width: 22px; height: 22px; }
.runcell { display: flex; align-items: center; gap: 10px; white-space: nowrap; color: #bbb; font-size: 14px; }
.ssbtn { border: 1px solid #555; background: #333; color: #eee; height: 30px; padding: 0 14px; border-radius: 3px; cursor: pointer; font-size: 14px; min-width: 72px; }
.ssbtn:hover { background: #444; }
.ssbtn.start { border-color: #3a7a3e; background: #234a26; color: #b8f0bb; }
.ssbtn.start:hover { background: #2c5e30; }
.ssbtn.pulse { animation: pulseG 1.4s ease-in-out infinite; }
@keyframes pulseG { 50% { box-shadow: 0 0 0 5px rgba(92,184,92,.3); } }
.openbtn { border: 0; background: #7b2fbe; color: #fff; height: 30px; padding: 0 16px; border-radius: 3px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.openbtn:hover { background: #8f3fd6; }
.prog { width: 130px; height: 6px; background: #444; border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 10px; }
.prog i { display: block; height: 100%; background: #2456a0; transition: width .1s linear; }
.muted { color: #8a8a8a; }
.sb-flag { font-size: 12px; color: #9cc3ff; background: #172741; border: 1px solid #2f5fa8; padding: 2px 8px; border-radius: 10px; margin-left: 8px; white-space: nowrap; }
.sb-flag.off { color: #999; background: #262626; border-color: #444; }

/* ───────────── Generic app pages ───────────── */
.app-wrap { padding: 28px 30px; display: grid; gap: 24px; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); align-items: start; flex: 1; }
.app-wrap.one { grid-template-columns: 1fr; }
.acard { background: #2f2f2f; border-radius: 4px; min-height: 120px; }
.acard .tabs { display: flex; border-bottom: 3px solid #2456a0; }
.acard .tabs span { flex: 1; text-align: center; padding: 14px; font-size: 17px; color: #ddd; }
.acard .tabs span.off { color: #888; border-bottom: 3px solid transparent; margin-bottom: -3px; background: #292929; }
.acard .in { padding: 22px; }
.acard h4 { margin: 0 0 14px; font-weight: 500; font-size: 21px; }
.acard h5 { margin: 18px 0 10px; font-weight: 500; font-size: 18px; }
.ttab { width: 100%; border-collapse: collapse; margin-bottom: 26px; }
.ttab th { background: #383838; font-weight: 500; font-size: 15px; padding: 5px; }
.ttab td { padding: 8px 4px; font-size: 14px; }
.mono { font-family: inherit; background: #111; color: #ccc; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.gbtn { background: #666; border: 0; color: #eee; padding: 6px 12px; border-radius: 3px; font-size: 14px; cursor: pointer; }
.savebar { height: 58px; flex: none; background: #111; display: flex; align-items: center; gap: 8px; padding: 0 20px; position: sticky; bottom: 0; }
.savebar .gbtn { padding: 9px 20px; font-size: 16px; }
.lst { border: 1px solid #444; border-radius: 6px; padding: 14px; margin-bottom: 12px; }
.badge-ok { background: #1f4d2a; color: #6fe08a; font-size: 12px; padding: 2px 6px; border-radius: 3px; letter-spacing: .04em; }
.badge-off { background: #4a2222; color: #ff8a80; font-size: 12px; padding: 2px 6px; border-radius: 3px; letter-spacing: .04em; }
.xgrid { display: grid; gap: 3px; }
.xgrid div { background: #3a3a3a; border-radius: 2px; aspect-ratio: 1; }
.xgrid div.on { background: #2456a0; }
.xgrid .hd { background: none; font-size: 12px; color: #aaa; display: flex; align-items: center; justify-content: center; aspect-ratio: auto; }
.tally { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tally div { background: #1d1d1d; border-radius: 6px; padding: 28px 10px; text-align: center; font-size: 20px; border: 2px solid #333; }
.tally div.pgm { background: #6b1414; border-color: #e5534b; } .tally div.pvw { background: #154a1d; border-color: #5cb85c; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 14px; font-size: 15px; }
.kv span:nth-child(odd) { color: #999; }
.app-hero { display: flex; gap: 18px; align-items: center; margin-bottom: 16px; }
.app-hero .ico { width: 64px; height: 64px; }

/* ───────────── Mockup controls ───────────── */
.mk-fab {
  position: fixed; right: 16px; bottom: 44px; z-index: 80; border: 1px solid #3b3b3b; background: rgba(20,20,20,.92); color: #cfcfcf;
  border-radius: 18px; padding: 7px 14px; cursor: pointer; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.5);
}
.mk-fab:hover { color: #fff; border-color: #555; }
.mk-panel {
  position: fixed; right: 16px; bottom: 86px; z-index: 81; width: 340px; background: #f4f4f2; color: #1b1b1b; border-radius: 14px; padding: 16px 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,.6); display: none; font-size: 13px; max-height: calc(100vh - 120px); overflow: auto;
}
.mk-panel.show { display: block; }
.mk-panel h4 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.mk-panel .lead { color: #666; margin: 0 0 12px; line-height: 1.4; }
.mk-panel label.grp { display: block; font-weight: 700; margin: 12px 0 6px; font-size: 12px; text-transform: none; letter-spacing: .05em; color: #555; }
.mk-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.mk-seg button { border: 1px solid #ccc; background: #fff; color: #222; border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 13px; }
.mk-seg button.on { background: #1d1d1d; color: #fff; border-color: #1d1d1d; }
.mk-panel .desc { color: #666; margin-top: 6px; line-height: 1.4; }
.mk-panel ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.55; color: #333; }
.mk-panel .reset { margin-top: 14px; border: 0; background: #c63c3c; color: #fff; border-radius: 8px; padding: 7px 12px; cursor: pointer; }

/* ───────────── Narrow screens ───────────── */
.top-menu { display: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: #ccc; cursor: pointer; place-items: center; flex: none; margin-left: -6px; }
.top-menu:hover { background: #1c1c1c; color: #fff; }
.scrim { display: none; }
.sb-item { touch-action: pan-y; -webkit-touch-callout: none; }

/* Tablet / small laptop: the expanded sidebar floats over the page instead of squeezing it. */
@media (min-width: 761px) and (max-width: 1100px) {
  .shell.open .rail { position: fixed; left: 0; top: 0; bottom: 0; box-shadow: 12px 0 40px rgba(0,0,0,.55); }
  .shell.open .main { margin-left: var(--rail-w); }
}
@media (max-width: 1000px) {
  .r-split { grid-template-columns: 1fr; }
  .r-split > .div { display: none; }
  .set-grid, .app-wrap { grid-template-columns: 1fr; }
  .cfg { grid-template-columns: 1fr; }
  .cfg > .div { display: none; }
  .inspector h3 { margin: 16px 12px 24px; }
}

/* Phone: the sidebar becomes a drawer opened from the menu button in the header. */
@media (max-width: 760px) {
  :root { --top-h: 56px; }
  .rail {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 84vw); z-index: 60;
    transform: translateX(-102%); transition: transform .25s cubic-bezier(.3,.7,.3,1);
  }
  .shell.drawer .rail { transform: none; box-shadow: 0 0 50px rgba(0,0,0,.7); }
  .sb-item .lbl { opacity: 1; }
  .rail-toggle svg { display: none; }
  .rail-toggle::before { content: '✕'; font-size: 18px; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .shell.drawer .scrim { opacity: 1; pointer-events: auto; }
  .top-menu { display: grid; }
  .topbar { padding: 0 14px; gap: 8px; }
  .page-title { font-size: 20px; }
  .brand { height: 11px; }

  .r-subbar { font-size: 15px; }
  .r-viewtg { display: none; }
  .r-left-in { margin: 10px 6px; padding: 10px; }
  .r-tab.wide { min-width: 0; }
  .p-card { grid-template-columns: 1fr 64px; padding: 16px 12px; }
  .p-card > div:nth-child(3) { grid-column: 1 / -1; margin-top: 14px; }
  .p-card h5, .p-card .pid { margin-bottom: 8px; }
  .dd { padding: 0 10px; font-size: 14px; }
  .p-hint { font-size: 14px; }
  .dev-wrap { padding: 12px 6px; }
  .warnbox { padding: 14px; font-size: 14px; }

  .toolbar { gap: 6px; }
  .chipbtn { font-size: 11px; padding: 0 8px; gap: 6px; }
  .tb-right { gap: 12px; font-size: 18px; }
  .optrow { font-size: 14px; }
  .optrow > span[style] { display: none; }
  .canvas { left: 10px; top: 10px; }
  .canvas-wrap { min-height: 420px; }

  .set-grid { padding: 12px; gap: 14px; }
  .frow .l { width: 160px; }
  .logs { height: 300px; font-size: 12px; }
  .bb { padding: 0 14px; font-size: 14px; }

  .pk { padding: 12px; gap: 12px; }
  .pk-nav { display: flex; gap: 4px; padding: 6px; overflow-x: auto; }
  .pk-nav .net { display: none; }
  .pk-nav a { font-size: 15px; margin: 0; padding: 8px 12px; gap: 8px; white-space: nowrap; }
  .pk-main { padding: 20px 14px; }
  .pk-main h2 { font-size: 22px; margin-bottom: 18px; }
  .pk-tools { gap: 10px; padding-bottom: 20px; margin-bottom: 20px; }
  .srch { width: 100%; }
  .lbtn { padding: 0 16px; font-size: 14px; }
  .launch { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }

  .app-wrap { padding: 12px; gap: 14px; }
  .tally { grid-template-columns: repeat(2, 1fr); }
  .kv { grid-template-columns: 110px 1fr; }
  .footer .r { display: none; }

  .mk-fab { right: 10px; bottom: 40px; }
  .mk-panel { right: 10px; left: 10px; width: auto; bottom: 82px; }
  .toast { max-width: calc(100vw - 20px); }
  .ctx { min-width: 240px; }
}

/* Phone: hidden apps fold out inline under "•••" */
.sb-item .chev {
  margin-left: auto; width: 9px; height: 9px; border-right: 2px solid #888; border-bottom: 2px solid #888;
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; flex: none; margin-right: 6px;
}
.sb-item.fold-open .chev { transform: rotate(-135deg) translate(-2px, -2px); }
@media (max-width: 760px) { .sb-item .badge { left: 46px; } }
.sb-fold { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s cubic-bezier(.3,.7,.3,1); flex: none; }
.sb-fold.open { grid-template-rows: 1fr; }
.sb-fold-in { overflow: hidden; min-height: 0; }
.sb-fold.open .sb-fold-in { border-left: 1px solid #2a2a2a; margin-left: 33px; }
.sb-sub {
  position: relative; height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 8px 0 18px; cursor: pointer;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; outline: none;
}
.sb-sub .ico { width: 32px; height: 32px; border-radius: 8px; }
.sb-sub .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #b5b5b5; font-size: 15px; }
.sb-sub:hover, .sb-sub:focus-visible { background: rgba(255,255,255,.045); }
.sb-sub.active { background: rgba(255,255,255,.085); }
.sb-sub.active .lbl { color: #fff; }
.sb-sub.active::before {
  content: ''; position: absolute; left: -1px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent); box-shadow: 0 0 10px var(--accent);
}
.sub-pin {
  width: 34px; height: 34px; flex: none; border: 1px solid #3a3a3a; background: #1a1a1a; color: #ccc; border-radius: 9px;
  font-size: 16px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.sub-pin:hover { background: #2a2a2a; color: #fff; }

/* ───────────── Sidebar identity slot (top of expanded sidebar) ───────────── */
.rail-top { gap: 8px; padding-right: 10px; }
.rail-id { flex: 1; min-width: 0; opacity: 0; pointer-events: none; transition: opacity .15s; display: flex; align-items: center; }
.shell.open .rail-id { opacity: 1; pointer-events: auto; transition-delay: .06s; }
.rail-id img { height: 15px; margin-left: 6px; }
.dev-id { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.dev-id:hover { background: #1a1a1a; }
.dev-id .dot { width: 8px; height: 8px; }
.dev-id div { min-width: 0; }
.dev-id b { display: block; font-weight: 400; font-size: 15px; color: #f0f0f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-id small { display: block; font-size: 11.5px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell.open.rt-logo .topbar .brand { display: none; }
@media (max-width: 760px) {
  .rail-id { opacity: 1; pointer-events: auto; }
  .shell.rt-logo .topbar .brand { display: block; }
}

/* ───────────── Reactor views as tabs in the title bar ───────────── */
.hdr-reactor { display: flex; align-items: center; gap: 12px; height: 100%; min-width: 0; flex: 1; }
.hdr-reactor .ico { width: 30px; height: 30px; }
.hdr-app { font-size: 26px; color: #fff; white-space: nowrap; }
.hdr-tabs { display: flex; height: 100%; margin-left: 22px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.hdr-tabs::-webkit-scrollbar { display: none; }
.hdr-tab {
  position: relative; display: flex; align-items: center; padding: 0 20px; font-size: 17px; letter-spacing: .06em; color: #cfcfcf;
  cursor: pointer; white-space: nowrap; user-select: none;
}
.hdr-tab:hover { color: #fff; background: #151515; }
.hdr-tab.on { color: #fff; background: #1d1d1d; }
.hdr-tab.on::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: #6c84d6; }
@media (max-width: 760px) {
  .hdr-app { display: none; }
  .hdr-tabs { margin-left: 4px; }
  .hdr-tab { padding: 0 10px; font-size: 14px; letter-spacing: .02em; }
}

/* ───────────── Legacy top menu (today's paradigm) ───────────── */
.shell.legacy .rail, .shell.legacy .scrim { display: none; }
.topbar.legacy { height: 50px; padding: 0 16px 0 0; gap: 0; background: #000; border-bottom: 0; }
.topbar.legacy .top-menu { display: none; }
.lg-app { display: flex; align-items: center; gap: 10px; padding: 0 18px 0 12px; height: 100%; flex: none; }
.lg-app .ico { width: 30px; height: 30px; }
.lg-app span { font-size: 31px; color: #fff; white-space: nowrap; }
.lg-menu { display: flex; height: 100%; flex: 1; min-width: 0; overflow: hidden; position: relative; }
.lg-item {
  display: flex; align-items: center; padding: 0 19px; font-size: 18px; letter-spacing: .1em; color: #e8e8e8; cursor: pointer;
  white-space: nowrap; flex: none; user-select: none;
}
.lg-item[hidden] { display: none; }
.lg-item:hover { background: #1a1a1a; }
.lg-item.on { background: #2b2b2b; }
.lg-item.new { animation: lgNew 2.4s ease-out; }
@keyframes lgNew { 0%, 30% { background: #2f5fa8; color: #fff; } }
.lg-more { position: static; display: flex; flex: none; }
.lg-more[hidden] { display: none; }
.lg-more.on > .lg-item { background: #2b2b2b; }
.lg-drop {
  display: none; position: fixed; top: 50px; min-width: 220px; background: #111; border: 1px solid #333; z-index: 70;
  box-shadow: 0 14px 30px rgba(0,0,0,.6); padding: 4px 0;
}
.lg-more.open .lg-drop { display: block; }
.lg-ditem { display: block; padding: 10px 18px; font-size: 16px; letter-spacing: .08em; color: #e8e8e8; cursor: pointer; }
.lg-ditem:hover { background: #222; }
.lg-ditem.on { background: #2b2b2b; }
.lg-dev { flex: none; color: #aaa; font-size: 15px; margin: 0 18px 0 12px; white-space: nowrap; }
.lg-dev b { color: #eee; font-weight: 400; margin-left: 8px; }
.topbar.legacy .brand { height: 22px; margin-left: 0; }
.lg-globe { color: #4cba52; font-size: 20px; margin-left: 10px; }
@media (max-width: 1000px) { .lg-dev { display: none; } }
@media (max-width: 760px) {
  .lg-app span { font-size: 22px; }
  .lg-item { font-size: 15px; padding: 0 12px; }
  .topbar.legacy .brand, .lg-globe { display: none; }
}

/* ───────────── Mockup guide panel ───────────── */
.mk-panel { bottom: 44px; }
.mk-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.mk-head h4 { margin: 0; }
.mk-min { border: 0; background: #e2e2de; color: #333; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1; }
.mk-min:hover { background: #d2d2cd; }
.mk-fab[hidden] { display: none; }
.na { opacity: .45; pointer-events: none; }
.na-note { margin-top: 12px; font-style: italic; color: #555; }
@media (max-width: 760px) { .mk-panel { bottom: 40px; } }

/* ───────────── Device preview stage ───────────── */
.stage { display: none; }
body.staged .shell { display: none; }
body.staged .stage {
  display: flex; position: fixed; inset: 0; align-items: center; justify-content: center; z-index: 1;
  background: radial-gradient(ellipse at 50% 40%, #3a3a3a 0%, #1c1c1c 70%);
}
.dev-wrap { display: flex; flex-direction: column; align-items: center; transform-origin: center; flex: none; }
.dev { background: #0a0a0a; box-shadow: 0 0 0 2px #3a3a3a, 0 40px 90px rgba(0,0,0,.65); }
.dev iframe { display: block; border: 0; background: #000; }
.dev-phone { padding: 14px; border-radius: 54px; }
.dev-phone iframe { border-radius: 40px; }
.dev-tablet { padding: 18px; border-radius: 38px; }
.dev-tablet iframe { border-radius: 20px; }
.stage-cap { margin-top: 18px; color: #9a9a9a; font-size: 15px; letter-spacing: .02em; white-space: nowrap; }
body.embedded .mk-fab, body.embedded .mk-panel { display: none !important; }
@media (min-width: 761px) and (max-width: 1100px) {
  .hdr-app { display: none; }
  .hdr-tabs { margin-left: 6px; }
  .hdr-tab { padding: 0 12px; font-size: 15px; letter-spacing: .03em; }
  .topbar .brand { height: 16px; }
}

/* ───────────── Sidebar groups (proposal) ───────────── */
.sb-group { position: relative; flex: none; height: 15px; display: flex; align-items: center; padding: 0 12px 0 16px; user-select: none; -webkit-user-select: none; }
.sb-group::before { content: ''; position: absolute; left: 18px; right: 18px; top: 50%; height: 1px; background: #2c2c2c; }
.sb-group:first-child { height: 4px; }
.sb-group:first-child::before { display: none; }
.sb-group .gname, .sb-group .gempty, .sb-group .g-menu { display: none; }
.sb-group.drop::before { background: #5a5a5a; }
/* Expanded (and phone drawer): real headings */
.shell.open .sb-group, .shell.drawer .sb-group { height: 38px; padding-top: 12px; border-top: 1px solid #1c1c1c; margin-top: 6px; }
.shell.open .sb-group:first-child, .shell.drawer .sb-group:first-child { border-top: 0; margin-top: 0; height: 28px; padding-top: 4px; }
.shell.open .sb-group::before, .shell.drawer .sb-group::before { display: none; }
.shell.open .sb-group .gname, .shell.drawer .sb-group .gname {
  display: block; font-size: 11.5px; letter-spacing: .1em; text-transform: none; color: #7d7d7d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0; cursor: default;
}
.shell.open .sb-group .gempty, .shell.drawer .sb-group .gempty { display: block; font-size: 11px; color: #4d4d4d; margin-right: 6px; white-space: nowrap; font-style: italic; }
.shell.open .sb-group .g-menu, .shell.drawer .sb-group .g-menu {
  display: grid; place-items: center; width: 26px; height: 22px; border: 0; border-radius: 6px; background: transparent; color: #777;
  cursor: pointer; opacity: 0; font-size: 15px; padding: 0; flex: none;
}
.shell.drawer .sb-group .g-menu { opacity: 1; }
.sb-group:hover .g-menu, .g-menu:focus-visible { opacity: 1 !important; }
.sb-group .g-menu:hover { background: #222; color: #fff; }
.shell.open .sb-group.drop .gname, .shell.drawer .sb-group.drop .gname { color: #cfe3ff; }
.g-input {
  flex: 1; min-width: 0; height: 24px; background: #151515; border: 1px solid #2456a0; border-radius: 6px; color: #fff; outline: none;
  font: inherit; font-size: 12px; letter-spacing: .08em; text-transform: none; padding: 0 8px;
}
.ctx-lbl { font-size: 11px; letter-spacing: .08em; text-transform: none; color: #777; padding: 6px 10px 2px; }

/* ───────────── Collapsed group marker alternatives ───────────── */
.shell:not(.open):not(.drawer) .sb-group.empty { display: none; }
/* While dragging, empty groups reappear as small drop zones */
body.dragging .shell:not(.open):not(.drawer) .sb-group.empty {
  display: flex; height: 26px; margin: 4px 10px; padding: 0 4px; justify-content: center; border: 1px dashed #4a4a4a; border-radius: 8px;
}
body.dragging .shell:not(.open):not(.drawer) .sb-group.empty::before, body.dragging .shell:not(.open):not(.drawer) .sb-group.empty::after { display: none; }
body.dragging .shell:not(.open):not(.drawer) .sb-group.empty .gname {
  display: block; font-size: 8px; letter-spacing: .05em; text-transform: none; color: #8a8a8a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 44px;
}
body.dragging .shell:not(.open):not(.drawer) .sb-group.empty.drop { border-color: #8ab4f8; }

/* Mini title */
.shell.gm-mini:not(.open):not(.drawer) .sb-group, .shell.gm-mini:not(.open):not(.drawer) .sb-group:first-child {
  height: 24px; padding: 6px 4px 0; justify-content: center;
}
.shell.gm-mini:not(.open):not(.drawer) .sb-group:first-child { height: 18px; padding-top: 0; }
.shell.gm-mini:not(.open):not(.drawer) .sb-group::before { display: none; }
.shell.gm-mini:not(.open):not(.drawer) .sb-group .gname {
  display: block; font-size: 8.5px; letter-spacing: .04em; text-transform: none; color: #7a7a7a; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 62px; text-align: center;
}

/* Title in the line */
.shell.gm-inline:not(.open):not(.drawer) .sb-group, .shell.gm-inline:not(.open):not(.drawer) .sb-group:first-child {
  height: 22px; padding: 0 8px; justify-content: center; gap: 4px;
}
.shell.gm-inline:not(.open):not(.drawer) .sb-group::before, .shell.gm-inline:not(.open):not(.drawer) .sb-group::after {
  content: ''; display: block; position: static; flex: 1; min-width: 4px; height: 1px; background: #2e2e2e;
}
.shell.gm-inline:not(.open):not(.drawer) .sb-group .gname {
  display: block; flex: none; font-size: 8px; letter-spacing: .05em; text-transform: none; color: #7a7a7a; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 40px;
}
.shell.gm-mini:not(.open):not(.drawer) .sb-group.drop .gname, .shell.gm-inline:not(.open):not(.drawer) .sb-group.drop .gname { color: #cfe3ff; }

/* "+ New group" row (expanded / drawer) */
.sb-newgroup {
  flex: none; margin: 8px 14px 2px; height: 30px; border: 1px dashed #333; border-radius: 8px; color: #777; font-size: 13px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; user-select: none;
}
.sb-newgroup:hover, .sb-newgroup:focus-visible { color: #ddd; border-color: #555; background: #151515; outline: none; }

/* ───────────── Device info at the bottom of the sidebar ───────────── */
.rail-foot { flex: none; border-top: 1px solid #1d1d1d; padding: 8px 0 10px; }
.dev-foot { position: relative; height: 52px; display: flex; align-items: center; gap: 14px; padding: 0 14px; cursor: pointer; outline: none; user-select: none; }
.dev-foot:hover, .dev-foot:focus-visible { background: rgba(255,255,255,.045); }
.dev-ico { position: relative; flex: none; width: 40px; height: 40px; }
.dev-ico .ico { width: 40px; height: 40px; border-radius: 10px; }
.dev-ico .dot { position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; border: 2.5px solid #0b0b0b; box-sizing: border-box; }
.dev-foot .dot.g { box-shadow: 0 0 8px rgba(76,186,82,.6); }
.dev-foot.off .dev-ico .ico { opacity: .6; }
.dev-txt { min-width: 0; opacity: 0; transition: opacity .15s; pointer-events: none; }
.shell.open .dev-txt, .shell.drawer .dev-txt { opacity: 1; transition-delay: .06s; }
.dev-txt b { display: block; font-weight: 400; font-size: 15px; color: #f0f0f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-txt small { display: block; font-size: 12px; color: #8a8a8a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-txt em { font-style: normal; color: #6fcf75; }
.dev-foot.off .dev-txt em { color: #ff8a80; }
@media (max-width: 760px) { .dev-txt { opacity: 1; } }

/* ───────────── Projects page ───────────── */
.proj-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.proj-tools .sp { flex: 1; }
table.proj tr.cur td { background: rgba(108,132,214,.08); }
table.proj .sb-flag { vertical-align: 2px; }


/* Professional interface system: brand, type, surfaces and action hierarchy. */
:root {
  --blue: #2456a0;
  --accent: #2456a0;
  --text: #ededed;
  --muted: #b0b0b0;
  --line: #404040;
  --focus: #9bbce9;
}
body { font-size: 14px; line-height: 1.45; }
.content h1, .page-title { font-size: 28px; font-weight: 500; line-height: 1.2; letter-spacing: -.015em; }
.content h2, .pk-main h2 { font-size: 24px; font-weight: 500; line-height: 1.25; margin: 0 0 24px; }
.content h3, .panel > h3, .pk-sec > h3, .inspector h3 { font-size: 19px; font-weight: 500; line-height: 1.3; }
.content h4, .acard h4 { font-size: 18px; font-weight: 500; line-height: 1.35; }
.content h5, .acard h5, .p-card h5 { font-size: 15px; font-weight: 500; line-height: 1.4; }
.content p, .note, .p-hint { font-size: 14px; line-height: 1.6; }
.content small, .nm-cell small, .pk-sec > p.sub, .muted, .note { color: var(--muted); }
.nm-cell b { font-size: 15px; font-weight: 500; line-height: 1.35; }
.nm-cell small { display: block; font-size: 13px; line-height: 1.4; max-width: 340px; }
.pk-sec > h3 small { font-size: 13px; color: var(--muted); font-weight: 400; }
.pk-nav a { font-size: 16px; }
.pk-nav .net { font-size: 13px; color: var(--muted); }
.pk-nav a.on { background: var(--blue); color: #fff; }
.pk-nav a.on .cnt { color: #fff; }
.pk-main, .pk-nav, .panel, .acard, .p-card { background: #292929; border: 1px solid #393939; border-radius: 8px; }
.pk-tools { gap: 12px; padding-bottom: 24px; margin-bottom: 24px; border-color: var(--line); }
.pk-sec { margin-bottom: 32px; }
.pk-sec > h3 { margin-bottom: 14px; }
.ltile { border-radius: 8px; background: #242424; }
.ltile:hover { background: #303030; border-color: #606060; transform: none; }
.ltile .nm { font-size: 14px; font-weight: 500; }
/* All text actions share size and geometry. Blue identifies a primary action. */
:is(.btn-g, .bb, .gbtn, .ssbtn, .openbtn, .lbtn, .pin-btn),
.savebar .gbtn, .lbtn.sm, .ssbtn.start, .bb.green, .bb.orange {
  height: 34px; min-height: 34px; padding: 0 14px;
  display: inline-flex; justify-content: center; align-items: center; gap: 6px;
  border: 1px solid #525252; border-radius: 6px;
  background: #333; color: #ededed; font-size: 14px; font-weight: 500;
  line-height: 1; white-space: nowrap; cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}
:is(.btn-g, .bb, .gbtn, .ssbtn, .openbtn, .lbtn, .pin-btn):hover:not(:disabled) {
  background: #414141; border-color: #747474;
}
:is(.primary, .lbtn.pri), .pk-main [data-act="open"], .pk-main [data-act="install"], .pk-main [data-act="updall"] {
  background: var(--blue); border-color: var(--blue); color: #fff;
}
:is(.primary, .lbtn.pri):hover:not(:disabled),
.pk-main :is([data-act="open"], [data-act="install"], [data-act="updall"]):hover:not(:disabled) {
  background: var(--blue); border-color: #9bbce9;
}
button:disabled, button[aria-disabled="true"] { opacity: .38; cursor: not-allowed; box-shadow: none; animation: none; }
button:focus-visible, [role="button"]:focus-visible, a:focus-visible, .ver:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 3px;
}
.icbtn { width: 34px; height: 34px; border-radius: 6px; color: #b8b8b8; }
.icbtn:hover:not(:disabled) { background: #383838; color: #fff; }
.icbtn[data-act="uninstall"]:hover:not(:disabled), .icbtn[title="Delete"]:hover { color: #ffaaa4; background: #412b29; }
.ltile .pin, .ltile .pin.on, .sb-flag, .sb-flag.off {
  background: #303030; border: 1px solid #505050; color: #c5c5c5; border-radius: 5px; font-size: 12px;
}
.ltile .pin { min-height: 28px; padding: 4px 10px; }
.ltile .pin:hover { background: #3b3b3b; filter: none; }
.ver, .srch, .logsel, .dd { background: #222; border: 1px solid #484848; border-radius: 6px; }
.ver { font-size: 13px; padding: 7px 10px; }
.srch { width: min(240px, 100%); }
.srch input { font-size: 14px; }
.srch:focus-within { border-color: var(--focus); }
table.pt { font-size: 14px; }
table.pt th, .ttab th { font-size: 12px; font-weight: 500; color: #b0b0b0; }
table.pt td { padding: 12px 10px; }
table.pt tr:hover td { background: rgba(255,255,255,.025); }
.runcell { font-size: 13px; color: #c0c0c0; }
.runcell .dot.r { background: #999; }
.hl-bar .sb-item.active::before { box-shadow: none; }
.hl-ring .sb-item.active .ico { box-shadow: 0 0 0 2px #0b0b0b, 0 0 0 4px var(--blue); }
.tg::after { background: #ddd; }
.tg.on { background: var(--blue); }
.tg.on::after { background: #fff; box-shadow: none; }
.chipbtn, .chipbtn.fit { background: #333; border: 1px solid #525252; border-radius: 6px; font-size: 12px; letter-spacing: 0; }
.chipbtn.sel { background: var(--blue); border-color: var(--blue); box-shadow: none; }
.tabs2 span.on { color: #fff; background: var(--blue); box-shadow: none; }
.p-card .pid, .frow, .optrow, .dd, .dev-card, .logsel { font-size: 14px; }
.dev-foot .dot.g { box-shadow: none; }
@media (max-width: 760px) {
  .page-title { font-size: 22px; }
  .pk-main h2 { font-size: 21px; }
  .pk-tools { gap: 10px; }
}

/* Shared outline icons and understated, readable notices. */
button, input, select, textarea { font-family: inherit; }
.ui-icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.gear-s { width: 18px; height: 18px; color: #bcbcbc; margin-left: 6px; }
.bulb { background: transparent; border: 1px solid #505050; color: #bcbcbc; }
.bulb svg { fill: none; color: inherit; width: 20px; height: 20px; }
.info-i { border: 0; width: 20px; height: 20px; font-style: normal; color: #bcbcbc; }
.warnbox, .orange-box, .yellow-box {
  background: #2c2a25; border: 1px solid #655739; border-left: 3px solid #d6ad56;
  color: #e6e1d5; border-radius: 8px; padding: 16px 18px; font-size: 14px; line-height: 1.55;
}
.warnbox .head { display: flex; align-items: center; gap: 10px; text-align: left; font-size: 15px; font-weight: 500; margin-bottom: 12px; padding-right: 24px; }
.warnbox .head::after { color: #bdb6a6; }
.warnbox .row { font-size: 13px; gap: 10px; color: #c9c3b5; align-items: flex-start; overflow-wrap: anywhere; }
.warning-symbol { color: #d6ad56; display: inline-flex; flex: none; margin-top: 1px; }
.warning-symbol .ui-icon { width: 22px; height: 22px; }
.orange-box { align-items: flex-start; gap: 12px; }
.dev-card { background: #242424; border: 1px solid #3c3c3c; border-radius: 8px; padding: 16px; gap: 16px; }
.dev-card .st, .p-card .st { color: #ef948b; font-size: 13px; }
.dev-group { font-size: 15px; font-weight: 500; margin: 20px 0 12px; }
.p-hint { font-style: normal; color: #b0b0b0; }
.p-hint b { color: #ddd; font-weight: 500; }
.sb-sub.active::before { box-shadow: none; }
.hl-ring .sb-item.active .ico { box-shadow: 0 0 0 2px #0b0b0b, 0 0 0 4px var(--accent); }
/* Legible toolbar icons: no platform emoji or font-dependent symbols. */
.tb-right { gap: 8px; color: #c4c4c4; font-size: 16px; }
.tool-icon, .tb-ico { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; border-radius: 6px; }
.tool-icon .ui-icon, .tb-ico .ui-icon { width: 22px; height: 22px; }
.tool-icon:hover, .tb-ico:hover { background: #383838; color: #fff; }
.gear-s { width: 21px; height: 21px; }
.icbtn .gear-s { margin-left: 0; width: 22px; height: 22px; }
.footer .ui-icon { width: 18px; height: 18px; }
.sb-group .gname, .rail .gname { font-size: 12px; }
.nm-cell small, .runcell, .pk-sec > p.sub { font-size: 14px; }
.pk-main table.pt th { font-size: 13px; }
.warnbox .row { font-size: 14px; }

/* Compact inline notices: a single severity cue, human-readable copy,
   and keyboard-accessible disclosure for the original diagnostic text. */
.warnbox, .orange-box {
  display: flex; align-items: flex-start; gap: 12px;
  background: #2a2926; border: 1px solid #48443a; border-left: 3px solid #d6ad56;
  border-radius: 6px; padding: 16px; color: #e7e7e7;
}
.notice-content { flex: 1; min-width: 0; }
.content .notice-content h4 { font-size: 15px; line-height: 1.4; font-weight: 500; margin: 0 0 4px; }
.content .notice-content p { font-size: 14px; line-height: 1.5; color: #bdbbb5; margin: 0; overflow-wrap: anywhere; }
.notice-address { white-space: nowrap; color: #ddd; }
.notice-details { margin-top: 10px; }
.notice-details summary { width: fit-content; cursor: pointer; color: #d1d1cc; font-size: 13px; line-height: 1.5; }
.notice-details summary:hover { color: #fff; }
.notice-details summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
.content .notice-details p { margin-top: 10px; padding-top: 10px; border-top: 1px solid #45423a; font-size: 13px; }
.warnbox .warning-symbol, .orange-box .warning-symbol { margin-top: 0; }
.warning-symbol .ui-icon { width: 20px; height: 20px; }
/* Explicit line boxes use corrected font metrics consistently in controls. */
:is(.btn-g,.bb,.gbtn,.ssbtn,.openbtn,.lbtn,.pin-btn), .savebar .gbtn, .lbtn.sm,
.ssbtn.start,.bb.green,.bb.orange { line-height: 20px; padding-block: 6px; }
.ltile .pin, .sb-flag, .sb-flag.off, .dd .chip { line-height: 18px; }
.srch input { line-height: 20px; padding-block: 0; }
/* Compact secondary actions retain readable glyphs and generous targets. */
.icbtn { width: 36px; height: 36px; display: inline-grid; place-items: center; vertical-align: middle; }
.icbtn .ui-icon { width: 22px; height: 22px; }
.icbtn[aria-label^="Delete"]:hover { color: #ffaaa4; background: #412b29; }

/* Alternative warning: neutral card with a small amber severity label. */
.warnbox, .orange-box {
  background: #292929; border: 1px solid #454545; border-left: 1px solid #454545;
  border-radius: 8px; padding: 18px; gap: 14px;
}
.notice-label {
  display: inline-block; color: #e0bb70; background: #393225;
  border: 1px solid #5b4d32; border-radius: 4px;
  font-size: 12px; font-weight: 500; line-height: 18px;
  padding: 2px 7px 0; margin-bottom: 8px;
}
.warnbox .warning-symbol, .orange-box .warning-symbol {
  width: 32px; height: 32px; border-radius: 7px; background: #363125;
  display: inline-flex; align-items: center; justify-content: center; margin-top: 0;
}
.content .notice-content h4 { font-weight: 500; margin-bottom: 6px; }
.content .notice-content p { color: #bdbdbd; }
.notice-details summary { color: #c3c3c3; }
/* Optical adjustment: shift text down within fixed-height controls. */
:is(.btn-g,.bb,.gbtn,.ssbtn,.openbtn,.lbtn,.pin-btn),
.savebar .gbtn,.lbtn.sm,.ssbtn.start,.bb.green,.bb.orange { padding-top: 7px; padding-bottom: 5px; }
.ltile .pin { padding-top: 5px; padding-bottom: 3px; }
.sb-flag,.sb-flag.off,.dd .chip { padding-top: 3px; padding-bottom: 1px; }
/* Status colour reflects whether a package is running. */
.pk-main .runcell .dot.r { background: var(--red); }
.pk-main .runcell .dot.g { background: var(--green); }
.support-notice { margin-top: 18px; }
/* Centre package metadata headings; keep names and descriptions left aligned. */
.pk-main table.pt th.col-centered { text-align: center; }
.pk-main table.pt td:nth-child(2),
.pk-main table.pt td:nth-child(3),
.pk-main table.pt td:nth-child(6),
.pk-main table.pt td:nth-child(7),
.pk-main table.pt td:nth-child(8) { text-align: center; }
.pk-main table.pt td .runcell { justify-content: center; }
.pk-main table.pt td .sb-flag { margin-left: 0; }

.pk-main table.pt th.col-version,
.pk-main table.pt td.col-version { text-align: left; }
/* One physical stroke weight, independent of viewBox and nested transforms. */
svg.ico > g :is(path,rect,circle,ellipse,line,polyline,polygon),
svg[stroke] :is(path,rect,circle,ellipse,line,polyline,polygon) {
  stroke-width: 1.75px;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Lighter heading hierarchy: regular page titles, medium section headings. */
.content h1, .page-title, .hdr-app { font-weight: 400; }
.content h2, .pk-main h2 { font-weight: 400; }
.content h3, .panel > h3, .pk-sec > h3, .inspector h3,
.content h4, .acard h4, .content h5, .acard h5, .p-card h5,
.content .notice-content h4, .dev-group { font-weight: 500; }

/* ───────────── Settings: sub-menu + sections (after the Settings reference screens) ───────────── */
.sx { flex: 1; display: grid; grid-template-columns: var(--sx-nav-w, 264px) 24px minmax(0, 1fr); gap: 0; padding: 24px; align-items: stretch; }
.sx-nav, .sx-main { background: #292929; border: 1px solid #393939; border-radius: 8px; min-width: 0; }
.sx-nav { padding: 18px 0 24px; align-self: stretch; }
.sx .sx-nav h2 { margin: 0 0 30px; padding: 0 28px; font-size: 28px; font-weight: 400; line-height: 1.2; }
.sx-menu { display: flex; flex-direction: column; }
.sx-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 0; color: #e8e8e8; font: inherit; font-size: 16px; line-height: 20px; padding: 14px 28px 12px 40px; cursor: pointer; }
.sx-item:hover { background: #313131; }
.sx-item.on { background: #1d1d1d; color: #fff; }
.sx-item:focus-visible { outline-offset: -2px; }
.sx-main { display: flex; flex-direction: column; }
.sx-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px 30px 0; flex-wrap: wrap; }
.sx .sx-head h2 { margin: 0; font-size: 28px; font-weight: 400; line-height: 1.2; }
.sx-headr { display: flex; align-items: center; gap: 24px; }
.sx-head.tabbed { padding: 0 30px 0 0; border-bottom: 1px solid #444; align-items: stretch; }
.sx-tabs { display: flex; }
.sx-tab { background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: #a9a9a9; font: inherit; font-size: 26px; line-height: 30px; padding: 26px 44px 14px; cursor: pointer; margin-bottom: -1px; }
.sx-tab:hover { color: #fff; }
.sx-tab.on { color: #fff; border-bottom-color: var(--blue); }
.sx-head.tabbed .sx-net { align-self: center; }
.sx-net { display: flex; align-items: center; gap: 8px; color: #b0b0b0; font-size: 14px; white-space: nowrap; }
.sx-globe { width: 24px; height: 24px; color: var(--green); }
.sx-body { padding: 30px 30px 40px; flex: 1; min-width: 0; }

.sx h3 { margin: 0 0 6px; font-size: 19px; font-weight: 400; line-height: 1.3; }
.sx p { margin: 4px 0 12px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.sx-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 52px; }
.sx-cell { padding: 24px 0; border-top: 1px solid #484848; min-width: 0; }
.sx-cell.first { border-top: 0; padding-top: 0; }
.sx-group { padding-bottom: 28px; }
.sx-group + .sx-group, .sx-group + .sx-cell { margin-top: 4px; }
.sx-stackg { display: flex; flex-direction: column; gap: 4px; max-width: 760px; }
.sx-stackg .sx-group { border-top: 1px solid #484848; padding: 26px 0 8px; }
.sx-stackg .sx-group:first-child { border-top: 0; padding-top: 0; }
.sx-stack { display: flex; flex-direction: column; gap: 18px; margin-bottom: 24px; }
.sx-tgrow { display: flex; gap: 14px; align-items: flex-start; }
.sx-tgrow .tg { margin-top: 1px; }
.sx-tgrow b { font-weight: 400; font-size: 18px; line-height: 24px; }
.sx-tgrow p { margin: 2px 0 0; }
.sx .tg:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.sx-gap { height: 18px; }
.sx-dev { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.sx-device { width: 164px; height: auto; flex: none; border-radius: 6px; }
.sx-info { display: grid; grid-template-columns: auto auto; gap: 8px 30px; margin: 0; font-size: 17px; line-height: 22px; }
.sx-info dt { color: #b8b8b8; } .sx-info dd { margin: 0; color: #fff; }
.sx-btns { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.sx-btns.col { flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 22px; }
.sx-inline { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.sx-auth { margin: 14px 0 0 54px; display: flex; flex-direction: column; gap: 12px; }
.sx-val { font-size: 16px; color: #d8d8d8; }
.sx-usb { display: flex; align-items: center; gap: 14px; font-size: 15px; margin: 2px 0 10px; }
.sx-usb .dim { color: #8a8a8a; }
.sx-lbl { font-size: 15px; color: #cfcfcf; }

.sxb { display: inline-flex; align-items: center; justify-content: center; height: 30px; padding: 3px 16px 0; background: var(--blue); color: #fff; border: 0; border-radius: 3px; font: inherit; font-size: 14px; line-height: 20px; cursor: pointer; white-space: nowrap; }
.sxb:hover { background: #2f68bd; }
.sxb.danger { background: #b83a34; } .sxb.danger:hover { background: #cf4740; }
.sx-in { background: #1b1b1b; border: 1px solid #484848; border-radius: 4px; color: #e4e4e4; height: 32px; padding: 3px 10px 0; font: inherit; font-size: 14px; min-width: 0; width: 200px; box-sizing: border-box; }
.sx-in:focus { outline: 0; border-color: var(--focus); }
.sx-in:disabled { opacity: .5; }
select.sx-in { padding-top: 0; cursor: pointer; }
.sx-form { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px 14px; align-items: center; max-width: 520px; margin: 4px 0 30px; font-size: 15px; color: #c8c8c8; }
.sx-form .sx-in { width: 220px; }
.sx-narrow { max-width: 760px; }

.sx-tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.sx-tbl th { background: #222; color: #b0b0b0; font-weight: 400; font-size: 12px; text-align: left; padding: 9px 12px; }
.sx-tbl td { padding: 8px 12px; border-bottom: 1px solid #333; vertical-align: middle; }
.sx-tbl th:first-child, .sx-tbl td:first-child { width: 64px; text-align: center; }
.sx-tbl th:last-child, .sx-tbl td:last-child { width: 130px; }
.sx-tbl .mut, .mut { color: #9a9a9a; }

.sx-events { background: #1b1b1b; height: 150px; border-radius: 2px; margin: 8px 0 14px; overflow: auto; }
.sx-cal { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; margin-top: 14px; }
.sx-calL { display: flex; flex-direction: column; gap: 8px; }
.sx-rng { display: grid; grid-template-columns: 112px 64px minmax(160px, 380px); gap: 14px 6px; align-items: center; }
.sx-group > .sx-rng { margin-top: 18px; }
.sx-rl { color: #c8c8c8; font-size: 15px; } .sx-rv { color: #fff; font-size: 15px; }
.sx-range { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; cursor: pointer; }
.sx-range::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(to right, var(--blue) var(--p, 0%), #4d4d4d var(--p, 0%)); }
.sx-range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--blue); border: 2px solid #8fb0e4; margin-top: -6.5px; }
.sx-range::-moz-range-track { height: 3px; border-radius: 2px; background: #383838; }
.sx-range::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--blue); }
.sx-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--blue); border: 2px solid #8fb0e4; }
.sx-range:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 4px; }

.sx-resetrow { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.sx-resetrow p { margin-bottom: 0; }
.sx-logbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sx-logs { background: #181818; font-size: 13.5px; line-height: 1.4; padding: 12px; height: min(58vh, 560px); overflow: auto; color: #ddd; word-break: break-all; margin-bottom: 14px; border-radius: 3px; }
.sx-logs .a1 { color: #2ab3c0; } .sx-logs .a2 { color: #d0569f; } .sx-logs .a3 { color: #57b06a; } .sx-logs .er { color: #e5534b; }

@media (max-width: 1100px) { .sx-grid { grid-template-columns: 1fr; } .sx-cell.first + .sx-cell.first { border-top: 1px solid #484848; padding-top: 24px; } }
@media (max-width: 900px) { .sx { grid-template-columns: 1fr; row-gap: 24px; } .sx-gutter { display: none; } .sx-cal { grid-template-columns: 1fr; } .sx-tab { font-size: 20px; padding: 18px 22px 12px; } }
@media (max-width: 760px) { .sx { padding: 12px; gap: 14px; } .sx-body { padding: 20px 16px 28px; } .sx-head { padding: 20px 16px 0; } .sx-form { grid-template-columns: 1fr; } .sx-rng { grid-template-columns: 100px 56px minmax(0, 1fr); } }

/* Apps and packages sub-menu: same full-width selected row as the Settings sub-menu. */
.pk-nav { padding: 20px 0 24px; overflow: hidden; }
.pk-nav .net { padding: 0 28px 14px; margin-bottom: 8px; }
.pk-nav a { border-radius: 0; margin-bottom: 0; padding: 14px 28px 12px 40px; font-size: 16px; line-height: 20px; color: #e8e8e8; }
.pk-nav a:hover { background: #313131; }
.pk-nav a.on { background: #1d1d1d; color: #fff; }
.pk-nav a.on .cnt { color: #9a9a9a; }

/* Draggable gutter between the Settings sub-menu and main content. */
.sx-gutter { position: relative; cursor: col-resize; touch-action: none; border-radius: 4px; }
.sx-gutter::before { content: ''; position: absolute; top: 12px; bottom: 12px; left: 50%; width: 3px; margin-left: -1.5px; border-radius: 2px; background: transparent; transition: background .15s; }
.sx-gutter:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.sx.resizing, .pk.resizing { user-select: none; cursor: col-resize; }
.sx.resizing *, .pk.resizing * { cursor: col-resize !important; }

/* Apps and packages: same foundation as Settings. Both panels fill the page, stretch to the same height
   and scroll together (the sub-menu no longer stays in place while the main content scrolls). */
.pk { flex: 1; padding: 24px; align-items: stretch; }
.pk-nav { position: static; align-self: stretch; padding: 18px 0 24px; }
.pk-main { padding: 28px 30px 40px; }
.pk .pk-main h2 { font-size: 28px; font-weight: 400; line-height: 1.2; margin: 0 0 30px; }
@media (max-width: 760px) { .pk { padding: 12px; } .pk-main { padding: 20px 14px; } }

/* Apps list without the Open UI column: the Sidebar column moves from 6th to 5th. */
.pk-main table.pt.noopen td:nth-child(4),
.pk-main table.pt.noopen td:nth-child(5) { text-align: center; }

/* Combined Running/Stopped + Start/Stop button: status dot inside the button. */
.ssbtn.stat { font-weight: 400; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 118px; }
.ssbtn.stat .dot { width: 10px; height: 10px; flex: none; }
.ssbtn.stat .spin { flex: none; }

/* Internet access status: right-aligned in the toolbar row, next to Manual Install / Update all. */
.pk-tools .net { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.sx-net .dot { margin: 0; }

/* ── Home (new version): Devices | Panels & Configurations, resizable like Settings ── */
.hx .hx-panel { display: flex; flex-direction: column; padding: 0; }
.hx-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 28px 26px 0; }
.hx .hx-head h2 { margin: 0; font-size: 28px; font-weight: 400; line-height: 1.2; }
.hx .hx-head p { margin: 14px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.hx-add { background: #2456a0; color: #fff; border: 0; border-radius: 3px; height: 38px; padding: 0 11px; font: inherit; font-size: 16px; cursor: pointer; white-space: nowrap; flex: none; }
.hx-add:hover { background: #2f6bc4; }
.hx-body { padding: 36px 26px 30px; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 36px; }
.hx-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #7d7d7d; font-size: 19px; text-align: center; padding: 60px 0; }
.hx-empty.big { padding: 110px 0; }
.hx-step { width: 56px; height: 56px; border-radius: 50%; border: 3px solid #6c6c6c; display: grid; place-items: center; font-size: 26px; color: #7d7d7d; }
.hx-chev { color: #777; flex: none; }
.hx-dgroup { background: #292929; border: 1px solid #393939; border-radius: 8px; overflow: hidden; }
.hx-dhead { background: #1e1e1e; padding: 9px 14px; font-size: 16px; display: flex; align-items: center; gap: 12px; }
.hx-drows { padding: 22px 14px 14px; display: flex; flex-direction: column; gap: 22px; }
.hx-drow { display: flex; align-items: center; gap: 22px; font-size: 20px; min-width: 0; }
.hx-drow .dot { width: 14px; height: 14px; margin-left: 4px; }
.hx-drow .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hx-drow .id, .hx-drow .ip { color: #8b8b8b; font-size: 15px; white-space: nowrap; }
.hx-drow .ip { min-width: 110px; }
.hx-pcard { background: #292929; border: 1px solid #393939; border-radius: 8px; padding: 28px 30px 34px; display: grid; grid-template-columns: auto 1fr; column-gap: 34px; row-gap: 0; align-items: center; }
.hx-pimg img { display: block; width: 150px; height: auto; border-radius: 4px; }
.hx-pinfo { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hx-prow { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.hx-prow .dot { width: 14px; height: 14px; }
.hx-prow .lbl { color: #8b8b8b; font-size: 15px; width: 36px; }
.hx-prow .lbl.cfg { width: auto; margin-right: 2px; }
.hx-prow .val { font-size: 22px; display: inline-flex; align-items: center; gap: 14px; margin-left: 10px; }
.hx-cfgbtn { background: none; border: 0; color: #fff; font: inherit; font-size: 22px; padding: 2px 4px; cursor: pointer; display: inline-flex; align-items: center; gap: 14px; border-radius: 4px; }
.hx-cfgbtn:hover { background: #333; }
.hx-pcard > .hx-sec { grid-column: 1 / -1; }
.hx-sec { border-top: 1px solid #3a3a3a; margin-top: 30px; padding-top: 26px; }
.hx-sec + .hx-sec { margin-top: 26px; }
.hx .hx-sec h3 { margin: 0; font-size: 21px; font-weight: 400; display: flex; align-items: center; gap: 14px; }
.hx .hx-sec p { margin: 8px 0 18px; font-size: 14px; }
.hx-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hx-chip { background: #2a2a2a; border: 2px solid #444; border-radius: 3px; color: #ddd; font: inherit; font-size: 15px; height: 48px; padding: 0 22px; display: inline-flex; align-items: center; }
.hx-chip.add { background: #1c1c1c; border: 2px dotted #4c4c4c; color: #ccc; cursor: pointer; }
.hx-chip.add:hover { background: #262626; }
@media (max-width: 760px) { .hx-pcard { grid-template-columns: 1fr; row-gap: 18px; } }
.hx .hx-head h2 { padding: 0; }
.hx-drow { gap: 14px; }
.hx-drow .ip { min-width: 0; margin-left: 6px; }
/* Home (new): smaller, clearly clickable names */
.hx-drow { width: 100%; background: none; border: 0; border-radius: 4px; color: #fff; font: inherit; font-size: 17px; text-align: left; padding: 6px 10px; margin: -6px 0; cursor: pointer; }
.hx-drow:hover { background: #333; }
.hx-drows { gap: 16px; padding: 20px 12px 14px; }
.hx-drow .dot { margin-left: 0; }
.hx-drow .id, .hx-drow .ip { font-size: 14px; }
.hx-cfgbtn { font-size: 17px; padding: 4px 8px; }
.hx-cfgbtn:hover .hx-chev, .hx-drow:hover .hx-chev { color: #ddd; }
.hx-prow .val { display: none; }
.hx-prow .hx-cfgbtn { margin-left: 2px; }
.hx-dhead { padding: 5px 8px; }
.hx-dhead .hx-cfgbtn { font-size: 16px; gap: 12px; padding: 4px 8px; }
.hx-dhead .hx-chev { position: relative; top: -2px; }
/* Home (new): value column shared by "PTZ Fly" and the configuration name */
.hx-prow { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 0; }
.hx-prow .hx-l { display: flex; align-items: center; gap: 10px; }
.hx-prow .lbl { width: auto; }
.hx-prow .hx-cfgbtn { justify-self: start; margin-left: 0; }
.hx-head .lbtn { flex: none; margin-top: 2px; }
/* Home (new): Presets bar above Devices / Panels & Configurations */
.hx { grid-template-rows: auto minmax(0, 1fr); row-gap: 20px; }
.hx > .hx-bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 36px; background: #292929; border: 1px solid #393939; border-radius: 8px; padding: 14px 30px 14px 30px; min-width: 0; }
.hx .hx-bar h2 { margin: 0; font-size: 28px; font-weight: 400; line-height: 1.2; padding: 0; }
.hx-bar .hx-cfgbtn { color: #cfcfcf; }
.hx-bar .sp { flex: 1; }
.hx-views { display: flex; gap: 12px; }
.hx-views button { background: none; border: 0; padding: 4px; border-radius: 4px; color: #6f6f6f; cursor: pointer; display: grid; place-items: center; }
.hx-views button:hover { color: #bbb; }
.hx-views button.on { color: #cfcfcf; }
.hx > .hx-panel, .hx > .sx-gutter { grid-row: 2; }
.hx > .hx-bar { padding-left: 26px; padding-right: 26px; }
/* Home (new): smaller empty-state hints */
.hx-empty { gap: 10px; font-size: 15px; }
.hx-step { width: 40px; height: 40px; border-width: 2px; font-size: 19px; }
.sx-info { align-items: baseline; } .sx-info dt { font-size: 14px; color: var(--muted); }
/* Buttons use the normal weight everywhere. */
:is(button, .lbtn, .btn-g, .bb, .gbtn, .ssbtn, .openbtn, .pin-btn, [role="button"]):not(#_) { font-weight: 400; }
/* Section titles (<h2>) are slightly smaller than the page title in the top bar (<h1>). */
.content h2, .pk .pk-main h2, .sx .sx-head h2, .sx .sx-nav h2, .hx .hx-head h2, .hx .hx-bar h2 { font-size: 24px; }
@media (max-width: 760px) { .content h2, .pk .pk-main h2, .sx .sx-head h2, .hx .hx-head h2, .hx .hx-bar h2 { font-size: 21px; } }
/* Sidebar group headings: slightly larger */
.shell.open .sb-group .gname, .shell.drawer .sb-group .gname { font-size: 13px; }
.shell.gm-mini:not(.open):not(.drawer) .sb-group .gname { font-size: 10px; max-width: 66px; }
.shell.gm-inline:not(.open):not(.drawer) .sb-group .gname { font-size: 9.5px; max-width: 46px; }
body.dragging .shell:not(.open):not(.drawer) .sb-group.empty .gname { font-size: 9.5px; max-width: 50px; }
.shell.gm-mini:not(.open):not(.drawer) .sb-group .gname { font-size: 9.5px; letter-spacing: 0; max-width: 68px; }
.shell.open .sb-group .gname, .shell.drawer .sb-group .gname { font-size: 12px; }
.shell.gm-mini:not(.open):not(.drawer) .sb-group { padding: 0; justify-content: center; }
.shell.gm-mini:not(.open):not(.drawer) .sb-group .gname { font-size: 11px; letter-spacing: -.01em; max-width: 68px; flex: none; text-overflow: clip; }
.hl-bar .sb-item.active::before { top: 0; bottom: 0; border-radius: 0; }

/* Resize handle: a pill that grows and brightens on hover / while dragging (8 × 80 → 8 × 128 px). */
.sx-gutter::before {
  top: 50%; bottom: auto; left: 50%; width: 8px; height: 80px; margin: 0; border-radius: 4px;
  background: #383838; transform: translate(-50%, -50%);
  transition: height .18s ease, background-color .18s ease;
}
.sx-gutter:hover::before, .sx-gutter:focus-visible::before, .sx.resizing .sx-gutter::before, .pk.resizing .sx-gutter::before { height: 128px; background: #808080; }
.sx-gutter:focus-visible { outline: 0; }
/* Sub-menu dragged fully out of sight: only the handle remains. */
@media (min-width: 901px) {
  .sx[data-collapsed="left"] > .sx-nav { visibility: hidden; border-width: 0; padding: 0; overflow: hidden; }
}
@media (min-width: 1151px) {
  .pk[data-collapsed="left"] > .pk-nav { visibility: hidden; border-width: 0; padding: 0; overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .sx-gutter::before { transition: none; } }
/* Handle drawn by a real element so it can stay centred in the visible area while the page scrolls. */
.sx-gutter::before { display: none; }
.sx-grip { position: sticky; top: calc(50% - 64px); display: flex; align-items: center; justify-content: center; height: 128px; }
.sx-grip i { display: block; width: 8px; height: 80px; border-radius: 4px; background: #383838; transition: height .18s ease, background-color .18s ease; }
.sx-gutter:hover .sx-grip i, .sx-gutter:focus-visible .sx-grip i, .sx.resizing .sx-grip i, .pk.resizing .sx-grip i { height: 128px; background: #808080; }
@media (prefers-reduced-motion: reduce) { .sx-grip i { transition: none; } }

/* Half-size handle (4 × 40 → 4 × 64) */
.sx-grip { top: calc(50% - 32px); height: 64px; }
.sx-grip i { width: 4px; height: 40px; border-radius: 2px; }
.sx-gutter:hover .sx-grip i, .sx-gutter:focus-visible .sx-grip i, .sx.resizing .sx-grip i, .pk.resizing .sx-grip i { height: 64px; }
/* Main content dragged fully out of sight: only the handle remains at the right edge. */
@media (min-width: 901px) {
  .sx[data-collapsed="right"] { grid-template-columns: minmax(0, 1fr) 24px 0; }
  .sx[data-collapsed="right"] > .sx-main { visibility: hidden; border-width: 0; padding: 0; overflow: hidden; }
}
@media (min-width: 1151px) {
  .pk[data-collapsed="right"] { grid-template-columns: minmax(0, 1fr) 24px 0; }
  .pk[data-collapsed="right"] > .pk-main { visibility: hidden; border-width: 0; padding: 0; overflow: hidden; }
}
.hl-bar .sb-item.active::before { top: 12px; bottom: 12px; }
.hl-bar .sb-item.active::before { top: 6px; bottom: 6px; }

/* ── FlowGrid: Routing ── */
.fg .sx-body.fg-body { padding: 24px 24px 30px; }
.fg-soon, .sx-soon { color: var(--muted); font-size: 15px; }
.fg-tools { display: flex; gap: 12px; align-items: center; }
.fg-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 14px; background: #1d1d1d; border: 1px solid #444; border-radius: 8px; color: #b0b0b0; }
.fg-search:focus-within { border-color: #7a7a7a; }
.fg-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: #fff; font: inherit; font-size: 16px; }
.fg-search input::placeholder { color: #8a8a8a; }
.fg-search input::-webkit-search-cancel-button { display: none; }
.fg-tools .lbtn { height: 40px; min-width: 76px; }
.fg-tools .lbtn.fg-take { min-width: 100px; background: #3f6a42; border-color: #3f6a42; color: #cfe3d0; }
.fg-tools .lbtn.fg-take.on { background: #2f9e44; border-color: #2f9e44; color: #fff; }
.fg-groups { display: flex; align-items: center; gap: 10px; margin: 18px 0 20px; flex-wrap: wrap; }
.fg-lbl { color: #b8b8b8; font-size: 15px; margin-right: 2px; }
.fg-spacer { flex: 1; }
.fg-gchip { background: #1f1f1f; border: 0; border-left: 4px solid var(--c); border-radius: 4px; color: #cfcfcf; font: inherit; font-size: 16px; height: 32px; padding: 0 14px 0 12px; cursor: pointer; }
.fg-gchip:not(.on) { opacity: .4; }
.fg-gchip:hover { background: #2a2a2a; }
.fg-tablewrap { overflow-x: auto; }
.fg-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.fg-table th { text-align: left; font-weight: 400; color: #b0b0b0; background: #202020; padding: 14px 8px; white-space: nowrap; }
.fg-table td { padding: 7px 8px; border-top: 1px solid #3a3a3a; height: 45px; }
.fg-table th:first-child, .fg-table td:first-child { padding-left: 14px; }
.fg-table .fg-c { text-align: center; }
.fg-row[hidden] { display: none; }
.fg-chk { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0; border: 1.5px solid #555; border-radius: 4px; background: #1d1d1d; cursor: pointer; display: block; }
.fg-chk:checked { background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 9.5l3 3 6-7'/%3E%3C/svg%3E") center/14px no-repeat; border-color: var(--blue); }
.fg-id { display: inline-block; min-width: 30px; padding: 4px 8px 3px 10px; background: #1d1d1d; border-left: 4px solid var(--c); border-radius: 4px; text-align: center; }
.fg-name { white-space: nowrap; }
.fg-ant { vertical-align: -5px; margin-right: 8px; color: #d8d8d8; }
.fg-sel { position: relative; display: block; width: 126px; }
.fg-sel select { appearance: none; -webkit-appearance: none; width: 100%; height: 30px; background: #151515; border: 1px solid #454545; border-radius: 6px; color: #fff; font: inherit; font-size: 15px; padding: 0 28px 0 10px; cursor: pointer; }
.fg-sel select:hover:not(:disabled) { border-color: #777; }
.fg-sel select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.fg-sel select:disabled { opacity: .5; cursor: not-allowed; }
.fg-sel svg { position: absolute; right: 9px; top: 8px; pointer-events: none; color: #cfcfcf; }
.fg-sel select option { background: #222; color: #fff; }
.fg-lock { background: none; border: 0; padding: 4px; color: #b8b8b8; cursor: pointer; border-radius: 4px; display: inline-grid; place-items: center; }
.fg-lock:hover { color: #fff; background: #333; }
.fg-lock.on { color: #f0b429; }
.fg-grp { display: inline-block; padding: 4px 10px 3px 10px; background: #1d1d1d; border-left: 4px solid var(--c); border-radius: 4px; white-space: nowrap; }
.fg-sec-note { color: var(--muted); }
/* FlowGrid sub-menu: Editor has sub points */
.sx-item.fg-parent { display: flex; align-items: center; justify-content: space-between; }
.fg-pchev { color: #8a8a8a; transition: transform .15s; }
.sx-item.fg-parent.open .fg-pchev { transform: rotate(90deg); }
.sx-item.fg-parent.open { color: #fff; }
.sx-item.fg-sub { padding: 11px 28px 9px 64px; font-size: 15px; color: #cfcfcf; }
.sx-item.fg-sub.on { color: #fff; }
/* Experiment: current page icon left of the page title */
.topbar .ttl-ico { display: flex; align-items: center; flex: none; margin-right: -3px; }
.topbar .ttl-ico .ico { display: block; }
@media (max-width: 760px) { .topbar .ttl-ico .ico { width: 28px; height: 28px; } }
/* Capital letters centred on the icon (measured: 0.04em puts the cap-height middle on the icon middle). */
.topbar .ttl-ico + .page-title { position: relative; top: .04em; }
.hx .hx-head p, .hx .hx-sec p { color: #8b8b8b; }
.hx .hx-sec h3 { font-size: 16px; font-weight: 400; }
/* Home (new): the section description spans the full width below the title row, so the button never wraps it. */
.hx-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 16px; }
.hx-head > div { display: contents; }
.hx .hx-head h2 { grid-column: 1; grid-row: 1; min-width: 0; }
.hx-head .lbtn { grid-column: 2; grid-row: 1; margin-top: 0; }
.hx .hx-head p { grid-column: 1 / -1; grid-row: 2; margin: 14px 0 0; }
.hx .hx-head p { margin-top: 10px; }
/* Home (new) headers: button raised so it no longer adds height to the title row; tighter title → description gap. */
.hx-head .lbtn { align-self: start; margin-top: -8px; }
.hx .hx-head p { margin-top: 4px; }
/* Home (new): section titles are links, like "PTZ Fly" (text stays aligned with the description below) */
.hx .hx-sec h3 .hx-cfgbtn { font-size: 16px; margin-left: -8px; }
.hx-pinfo .hx-cfgbtn { font-size: 16px; }

/* ── HTTP Device Core ── */
.ht-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; align-items: start; }
.ht-card { background: #232323; border: 1px solid #3c3c3c; border-radius: 10px; padding: 22px 24px 26px; min-width: 0; }
.ht-ch { display: flex; align-items: center; justify-content: space-between; }
.ht .ht-ch h3 { margin: 0; font-size: 18px; font-weight: 400; }
.ht .ht-sub { margin: 8px 0 22px; color: #8b8b8b; font-size: 14px; line-height: 1.5; }
.ht-fld { margin-bottom: 20px; }
.ht-fld label { display: block; font-size: 14px; margin-bottom: 8px; color: #e4e4e4; }
.ht .ht-fld p { margin: 8px 0 0; color: #8b8b8b; font-size: 13px; }
.ht-in { display: block; width: 100%; box-sizing: border-box; background: #151515; border: 1px solid #3a3a3a; border-radius: 6px; color: #e8e8e8; font: inherit; font-size: 14px; height: 38px; padding: 4px 12px 0; }
.ht-in:focus { outline: 0; border-color: var(--focus); }
textarea.ht-in { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.4; }
.ht-in.mono, .mono.ht-in { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.ht-selwrap { position: relative; display: block; }
.ht-selwrap select { appearance: none; -webkit-appearance: none; padding: 0 34px 0 12px; cursor: pointer; }
.ht-selwrap svg { position: absolute; right: 13px; top: 12px; pointer-events: none; color: #cfcfcf; }
.ht-selwrap option { background: #222; }
.ht-help { width: 20px; height: 20px; border: 1.5px solid #9a9a9a; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: #aaa; cursor: help; }
.ht-tbl { width: 100%; border-collapse: collapse; margin: 14px 0 10px; }
.ht-tbl th { text-align: left; font-weight: 400; font-size: 14px; color: #cfcfcf; padding: 8px 4px; border-bottom: 1px solid #3a3a3a; }
.ht-tbl td { padding: 10px 4px 0; }
.ht-tbl td:last-child, .ht-tbl th:last-child { width: 32px; }
.ht-tbl .ht-in { height: 32px; padding-top: 2px; }
.ht-x { background: none; border: 0; color: #a0a0a0; font-size: 22px; line-height: 1; cursor: pointer; border-radius: 4px; width: 28px; height: 28px; padding: 0 0 2px; }
.ht-x:hover { color: #fff; background: #333; }
.ht-add { display: flex; align-items: center; gap: 8px; margin: 14px auto 0; background: none; border: 0; color: #b8b8b8; font: inherit; font-size: 14px; cursor: pointer; padding: 6px 10px; border-radius: 6px; }
.ht-add:hover { color: #fff; background: #333; }
.ht-resp { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.ht-resp .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: #cfcfcf; word-break: break-all; }
/* HTTP Device Core sub-menu: plain group headings, "+ Add command" next to Commands */
.ht-mh { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px 12px 40px; font-size: 16px; line-height: 20px; color: #fff; }
.ht-mh .lbtn { flex: none; }
.ht-mh.gap-top { margin-top: 24px; }
.sx-item.ht-help-row { margin-top: 24px; }
.ht .ht-sub b { color: #e4e4e4; font-weight: 400; }
.ht-steps { margin: 6px 0 0; padding-left: 22px; color: #cfcfcf; font-size: 14px; line-height: 1.8; }
/* HTTP Device Core command pages: Duplicate / Delete in the top right corner */
.ht-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.ht-ibtn { width: 36px; height: 36px; display: grid; place-items: center; background: none; border: 0; border-radius: 6px; color: #b8b8b8; cursor: pointer; }
.ht-ibtn:hover { background: #3a3a3a; color: #fff; }
.ht-ibtn.danger:hover { color: #ff8a80; }

/* Home Projects bar tool icons */
.hx-bar .hx-tools { display: flex; align-items: center; gap: 4px; margin-right: 12px; }
.top-ibtn { width: 40px; height: 40px; display: grid; place-items: center; background: none; border: 0; border-radius: 6px; color: #b8b8b8; cursor: pointer; padding: 0; }
.top-ibtn:hover { background: #3a3a3a; color: #fff; }

/* Tooltips for Home bar icons */
.top-ibtn { position: relative; }
.top-ibtn[data-tip]::after { content: attr(data-tip); position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #0b0b0b; color: #e6e6e6; border: 1px solid #3a3a3a; border-radius: 4px; padding: 4px 8px; font-size: 12px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 50; }
.top-ibtn[data-tip]:hover::after, .top-ibtn[data-tip]:focus-visible::after { opacity: 1; }

/* Home view toggle: smaller icons + tooltips */
.hx-views { gap: 4px; }
.hx-views button { position: relative; width: 40px; height: 40px; padding: 0; }
.hx-views button svg { width: 22px; height: 22px; }
.hx-views button[data-tip]::after { content: attr(data-tip); position: absolute; top: calc(100% + 6px); right: 0; background: #0b0b0b; color: #e6e6e6; border: 1px solid #3a3a3a; border-radius: 4px; padding: 4px 8px; font-size: 12px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 50; }
.hx-views button[data-tip]:hover::after, .hx-views button[data-tip]:focus-visible::after { opacity: 1; }

/* Brighter hover on Home links (those ending with ›) */
.hx-cfgbtn:hover, .hx-drow:hover { background: #383838; }
.hx-cfgbtn:hover .hx-chev, .hx-drow:hover .hx-chev { color: #fff; }

/* Home › chevrons: +1px size, 2px up */
.hx-chev { width: 15px; height: 15px; position: relative; top: -2px; }
.hx-dhead .hx-chev { top: -2px; }

/* Device group header text color */
.hx-dhead .hx-cfgbtn { color: #8b8b8b; }

/* Device names (rows and CR-N300 chips) at <p> size */
.hx-drow { font-size: 16px; }

/* Settings > System: titles at <p> size (16px), descriptions smaller and grey */
.sx-sys .sx-cell h4, .sx-sys .sx-tgrow b { font-size: 16px; font-weight: 400; line-height: 24px; }
.sx-sys .sx-cell h4 { margin: 0 0 4px; }
.sx-sys .sx-cell p { color: #8b8b8b; font-size: 14px; }

/* Settings (all subpages): same title / description styling as System */
.sx-set .sx-body h4, .sx-set .sx-body .sx-tgrow b { font-size: 16px; font-weight: 400; line-height: 24px; }
.sx-set .sx-body h4 { margin: 0 0 4px; }
.sx-set .sx-body p { color: #8b8b8b; font-size: 14px; }

/* Settings > System: device values at <p> size, USB labels smaller */
.sx-info dd { font-size: 16px; }
.sx-usb { font-size: 14px; }

/* Apps & packages: names at <p> size (16px), descriptions small grey */
.pk-main .nm-cell b { font-size: 15px; font-weight: 400; line-height: 1.35; }
.pk-main .nm-cell small, .pk-main .pk-sec > p.sub { font-size: 13px; color: #8b8b8b; }

/* Apps & packages: no line below the toolbar */
.pk-main .pk-tools { border-bottom: 0; }

/* Keep warning-notice headings as before (they are <h4> too) */
.sx-set .sx-body .notice-content h4 { font-size: 15px; font-weight: 500; line-height: 1.4; margin: 0 0 6px; }

/* ───────────── Icons/ mockup overrides ───────────── */
/* Active app: the accent bar + well from the Sidebar mockup (Kenneth's version flattened it). */
.hl-bar .sb-item.active::before {
  top: 11px; bottom: 11px; width: 4px; border-radius: 0 4px 4px 0;
  background: var(--accent); box-shadow: 0 0 12px var(--accent);
}
.sb-sub.active::before { box-shadow: 0 0 10px var(--accent); }
/* Selected item in section menus (Settings, FlowGrid, Apps and packages, HTTP core): a blue line at the
   left edge, the vertical counterpart of the blue line under the selected TSL Toolbox tab. */
.sx-item, .pk-nav a { position: relative; }
.sx-item.on::before, .pk-nav a.on::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue);
}
.sx-item.fg-parent.on::before { display: block; }
/* "Glyph only" icons have no tile: grey glyphs, the active app in its own colour. */
svg.ico.st-glyph { color: #b4b4b4; }
.sb-item:hover svg.ico.st-glyph { color: #e6e6e6; }
.sb-item.active svg.ico.st-glyph, .sb-sub.active svg.ico.st-glyph { color: var(--accent); }
.ttl-ico svg.ico.st-glyph { color: #e6e6e6; }
body.icons-glyph .sb-item .ico, body.icons-glyph .sb-sub .ico { box-shadow: none !important; background: none; }
/* Icon style choice in the options panel */
.mk-icons button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px 5px 6px; }
.mk-icons button svg.ico { flex: none; border-radius: 4px; }
.mk-icons button svg.ico.st-glyph { color: #444; }
.mk-icons button.on svg.ico.st-glyph { color: #eee; }
.mk-lab { display: block; margin: 10px 0 4px; font-size: 13px; color: #2456a0; font-weight: 500; text-decoration: none; }
.mk-lab:hover { text-decoration: underline; }

/* Mockup ⇄ Icon lab switch: the same big control at the bottom centre of both pages. */
.pg-switch { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90; display: flex; gap: 4px; padding: 4px;
  background: rgba(18,18,18,.94); border: 1px solid #3d3d3d; border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.55); font-family: inherit; }
.pg-switch a { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 22px; border-radius: 999px; color: #cfd3d8;
  text-decoration: none; font-size: 16px; font-weight: 500; white-space: nowrap; transition: background-color .12s, color .12s; }
.pg-switch a svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.pg-switch a:hover { background: #2e2e2e; color: #fff; }
.pg-switch a[aria-current="page"] { background: #2456a0; color: #fff; cursor: default; }
.pg-switch a:focus-visible { outline: 2px solid #8fb6ee; outline-offset: 2px; }
@media (max-width: 760px) { .pg-switch { left: 12px; transform: none; bottom: 12px; } .pg-switch a { height: 40px; padding: 0 14px; font-size: 15px; } }
@media (prefers-reduced-motion: reduce) { .pg-switch a { transition: none; } }
body.embedded .pg-switch { display: none; }
.toasts { bottom: 88px; }
.mk-scen button { flex: none; }
@media (max-width: 760px) { .toasts { bottom: 70px; } }

/* ── Two-section layouts ──
   One or two sections under the top bar. The secondary section (menu, device list or settings) keeps its
   width and can be dragged; the main section takes the rest. .sx-r puts the secondary section on the right. */
.sx.sx-r { grid-template-columns: minmax(0, 1fr) 24px var(--sx-nav-w, 460px); }
.sx-side { min-width: 0; }
@media (min-width: 901px) {
  .sx.sx-r[data-collapsed="left"] { grid-template-columns: minmax(0, 1fr) 24px 0; }
  .sx.sx-r[data-collapsed="left"] > .sx-side { visibility: hidden; border-width: 0; padding: 0; overflow: hidden; }
  .sx.sx-r[data-collapsed="right"] { grid-template-columns: 0 24px minmax(0, 1fr); }
}
@media (max-width: 900px) { .sx.sx-r { grid-template-columns: 1fr; } }
.sx.tsl { align-items: start; }
.sx.tsl > .sx-gutter { align-self: stretch; }

/* Section band: a section without tabs starts with a title band of the same height as a tab row, so tops line up. */
.sec-band { display: flex; align-items: center; min-height: 53px; padding: 0 22px; border-bottom: 1px solid #393939; box-sizing: border-box; }
.sx .sec-band h2, .content .sec-band h2 { margin: 0; font-size: 17px; font-weight: 500; letter-spacing: 0; }

/* BMD ATEM */
.atm .atm-list { padding: 0; }
.atm-devs { display: flex; flex-direction: column; padding: 8px 0; }
.atm-dev { position: relative; display: grid; grid-template-columns: 1fr; justify-items: start; gap: 4px; width: 100%; text-align: left; background: none; border: 0; color: #e8e8e8; font: inherit; padding: 14px 22px 14px 26px; cursor: pointer; }
.atm-dev:hover { background: #313131; }
.atm-dev.on { background: #1d1d1d; color: #fff; }
.atm-dev.on::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue); }
.atm-dev:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.atm-dev img { height: 40px; width: auto; max-width: 100%; object-fit: contain; margin-bottom: 4px; }
.atm-dev img.off { opacity: .4; filter: grayscale(1); }
.atm-dev .nm { display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 1.3; }
.atm-dev .meta { color: var(--muted); font-size: 13px; padding-left: 18px; }
.atm .dot, .atm-card .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.atm .dot.g { background: var(--green, #3fb950); } .atm .dot.r { background: #e5484d; }
.atm-main { display: flex; flex-direction: column; min-width: 0; }
.atm-tabs { overflow-x: auto; scrollbar-width: thin; }
.atm-tabs span { flex: 1 0 auto; white-space: nowrap; padding: 14px 18px; cursor: pointer; }
.atm-tabs span:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.atm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.atm-card { display: flex; flex-direction: column; gap: 8px; background: #232323; border: 1px solid #393939; border-radius: 8px; padding: 16px 18px; }
.atm-card .lbl { color: var(--muted); font-size: 13px; }
.atm-card b { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 17px; }
.atm-main h3 { margin: 24px 0 10px; font-size: 15px; font-weight: 500; }
.atm-main h3:first-of-type { margin-top: 18px; }
.atm-me { display: flex; gap: 8px; }
.atm-bus { display: flex; flex-wrap: wrap; gap: 6px; }
.atm-src { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 56px; height: 52px; padding: 0 6px; background: #232323; border: 2px solid #444; border-radius: 8px; color: #e8e8e8; font: inherit; font-size: 13px; cursor: pointer; }
.atm-src small { font-size: 10px; color: var(--muted); line-height: 1; }
.atm-src:hover { background: #313131; }
.atm-src.pgm { border-color: #e5484d; background: rgba(229,72,77,.18); }
.atm-src.pvw { border-color: #3fb950; background: rgba(63,185,80,.16); }
.atm-src:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.atm-trans { display: flex; align-items: center; gap: 10px; }
.atm-names { max-width: 640px; }
/* Tab rows that don't fit scroll sideways; the cut-off edge fades so it's clear more tabs follow. */
.atm-tabs.ovf-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); }
.atm-tabs.ovf-l { -webkit-mask-image: linear-gradient(to right, transparent, #000 56px); mask-image: linear-gradient(to right, transparent, #000 56px); }
.atm-tabs.ovf-l.ovf-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent); }
.atm-dev img { height: 52px; }

/* Apps and packages: Installed and Available share the Name and Version column widths, so Version lines up. */
.pk-main table.pt-pk { table-layout: fixed; min-width: 900px; }
.pk-main table.pt-pk th:nth-child(1) { width: 34%; }
.pk-main table.pt-pk th:nth-child(2) { width: 120px; }
.pk-main table.pt-pk.noopen th:nth-child(3) { width: 130px; }
.pk-main table.pt-pk.noopen th:nth-child(4) { width: 96px; }
.pk-main table.pt-pk.noopen th:nth-child(5), .pk-main table.pt-pk.noopen th:nth-child(6) { width: 76px; }
.pk-main table.pt-pk .nm-cell > div { min-width: 0; }
.pk-main table.pt-pk td.col-version { color: #d6d6d6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-main table.pt-pk td:last-child { text-align: right; }
/* Update column: [ Update to 2.1.0 | ▾ ]. The ▾ part is the version picker. */
.vsplit { display: inline-flex; align-items: stretch; height: 34px; border: 1px solid #555; border-radius: 6px; background: #2a2a2a; vertical-align: middle; max-width: 100%; }
.vsplit .vs-btn, .vsplit .vs-lbl { display: flex; align-items: center; padding: 1px 12px 0; font: inherit; font-size: 14px; white-space: nowrap; border: 0; background: none; color: #f0f0f0; border-radius: 5px 0 0 5px; }
.vsplit .vs-btn { cursor: pointer; }
.vsplit .vs-btn:hover { background: #363636; }
.vsplit.up { background: var(--blue); border-color: var(--blue); }
.vsplit.up .vs-btn:hover { background: #2d64b4; }
.vsplit.down { border-color: #b8862d; }
.vsplit.same { border-color: #3a3a3a; background: none; }
.vsplit.same .vs-lbl { color: var(--muted); }
.vs-pick { position: relative; display: flex; align-items: center; justify-content: center; width: 32px; border-left: 1px solid rgba(255,255,255,.18); color: #e0e0e0; }
.vsplit.same .vs-pick { border-left-color: #3a3a3a; color: #bbb; }
.vs-pick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 14px; }
.vs-pick:hover { background: rgba(255,255,255,.08); }
.vs-pick:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; border-radius: 0 5px 5px 0; }
.vs-pick option { background: #222; color: #eee; }
.pk-pre { display: inline-flex; align-items: center; gap: 10px; color: #cfcfcf; font-size: 14px; white-space: nowrap; cursor: pointer; }
.pk-pre .tg:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.mk-seg button svg { vertical-align: -4px; }
/* Narrower fixed columns so the Update column fits next to the sub-menu at laptop width. */
.pk-main table.pt-pk { min-width: 820px; }
.pk-main table.pt-pk th:nth-child(1) { width: 27%; }
.pk-main table.pt-pk th:nth-child(2) { width: 104px; }
.pk-main table.pt-pk.noopen th:nth-child(3) { width: 122px; }
.pk-main table.pt-pk.noopen th:nth-child(4) { width: 92px; }
.pk-main table.pt-pk.noopen th:nth-child(5), .pk-main table.pt-pk.noopen th:nth-child(6) { width: 66px; }
.pk-main table.pt-pk .ssbtn.stat { min-width: 0; width: 100%; max-width: 112px; }
.pk-main table.pt-pk.pt-sys th:nth-child(3) { width: 122px; }
.pk-main table.pt-pk.pt-sys td:nth-child(3) { text-align: left; }
.pt-sys .runcell { display: inline-flex; align-items: center; gap: 8px; }
.pt-sys .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.pt-sys .dot.g { background: var(--green); } .pt-sys .dot.r { background: #e5484d; }
/* System: one summary card with one button; details on request. */
.sys-card { display: flex; align-items: center; gap: 20px; padding: 22px 24px; border: 1px solid #3c3c3c; border-radius: 8px; background: #232323; margin-top: 4px; }
.sys-card > div { flex: 1; min-width: 0; }
.sys-card h3 { margin: 0 0 4px; font-size: 19px; font-weight: 500; }
.sys-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.sys-card.upd { border-color: #2c5a9e; background: #1f2633; }
.sys-card.ok h3::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--green); margin-right: 10px; vertical-align: 2px; }
.sys-card .lbtn { flex: none; }
.sys-card .spin { flex: none; }
.sys-more { display: inline-flex; align-items: center; gap: 8px; margin: 16px 0 12px; padding: 6px 2px; background: none; border: 0; color: #cfcfcf; font: inherit; font-size: 14px; cursor: pointer; }
.sys-more:hover { color: #fff; }
.sys-more[aria-expanded="true"] svg { transform: rotate(180deg); }
.sys-more:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 760px) { .sys-card { flex-wrap: wrap; } }
/* Update column: let the button wrap to two lines instead of pushing the table wider. */
.pk-main table.pt-pk { min-width: 700px; }
.pk-main table.pt-pk th:nth-child(1) { width: 25%; }
.vsplit { height: auto; min-height: 34px; }
.vsplit .vs-btn, .vsplit .vs-lbl { white-space: normal; text-align: left; line-height: 1.25; padding: 6px 10px 5px; }
.pk-main table.pt-pk td:last-child { padding-right: 4px; }
/* Package (technical) names */
.nm-cell small.pkgname { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; color: #b9c4d2; }
/* Device cores managed by Reactor: shown running, but greyed out and not clickable to stop. */
.ssbtn.stat.managed { opacity: .55; cursor: help; }
.icbtn.managed { opacity: .35; cursor: help; }
.mg-note { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); text-align: center; white-space: nowrap; }
.pk-main table.pt-pk.pt-sys th:nth-child(1) { width: 34%; }
/* Scrolling tab row (ATEM): the row clips the inactive tabs' -3px overlap, so draw the line on each tab instead. */
.acard .tabs.atm-tabs { border-bottom: 0; }
.acard .tabs.atm-tabs span { margin-bottom: 0; border-bottom: 3px solid transparent; }
.acard .tabs.atm-tabs span:not(.off) { border-bottom-color: #2456a0; }

/* Settings tabs in the TSL / ui-universal style (same as the app cards). */
.sx-ttabs { display: flex; }
.sx-ttabs button { flex: 1; text-align: center; padding: 14px; font: inherit; font-size: 17px; color: #ddd; background: none; border: 0; border-bottom: 3px solid #2456a0; border-radius: 0; cursor: pointer; }
.sx-ttabs button.off { color: #888; border-bottom-color: transparent; background: #292929; }
.sx-ttabs button:first-child { border-top-left-radius: 8px; } .sx-ttabs button:last-child { border-top-right-radius: 8px; }
.sx-ttabs button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.sx-bodyr { display: flex; justify-content: flex-end; margin: -8px 0 8px; }
/* ATEM, two-level menu layout */
.atm-menu .atm-mname { display: flex; align-items: center; gap: 10px; min-width: 0; }
.atm-menu .sx-item.atm-mdev { padding-left: 28px; }
.atm-menu .sx-head { align-items: baseline; justify-content: flex-start; gap: 16px; }
.atm-menu .sx-body h3:first-child, .atm-menu .sx-body .atm-me + h3 { margin-top: 18px; }
