:root {
  --bg: #0f1419; --panel: #171e26; --panel2: #1f2832; --line: #2b3643;
  --text: #e6edf3; --muted: #8b98a5; --accent: #2f9e8f; --accent2: #3cc4b2;
  --danger: #d9534f; --warn: #e0a83a; --ok: #3fb950;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif; }
a { color: var(--accent2); }
button, select, input {
  font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 12px;
}
button { cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--accent2); }
button.danger { color: var(--danger); }
button:disabled { opacity: .45; cursor: default; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
code, .mono { font-family: Consolas, "Cascadia Mono", monospace; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.brand .logo { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, var(--accent2), #1d6f88);
  display: grid; place-items: center; color: #fff; font-size: 14px; }

/* login */
.center { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px; width: min(380px, 100%); }
.card h1 { font-size: 18px; margin: 18px 0 4px; }
.card p { color: var(--muted); margin: 0 0 18px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field input { width: 100%; padding: 9px 12px; }
.err { color: var(--danger); min-height: 20px; margin: 4px 0 8px; }

/* console */
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
main.console { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input { flex: 1; min-width: 180px; }
.devices { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.devices th, .devices td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.devices th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; background: var(--panel2); }
.devices tr:last-child td { border-bottom: none; }
.devices td.actions { text-align: right; white-space: nowrap; }
.devices td.actions button { margin-left: 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; background: var(--muted); }
.dot.on { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.dot.busy { background: var(--warn); }
.muted { color: var(--muted); }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-top: 22px; }
.panel h2 { font-size: 15px; margin: 0 0 8px; }
.panel pre { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; overflow-x: auto; margin: 8px 0; }
@media (max-width: 700px) { .devices .hide-sm { display: none; } }

/* viewer */
body.viewer { display: flex; flex-direction: column; overflow: hidden; }
.vbar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--panel);
  border-bottom: 1px solid var(--line); flex-wrap: wrap; z-index: 2; }
.vbar .name { font-weight: 600; margin-right: 6px; }
.vbar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 2px; }
.vbar button, .vbar select { padding: 4px 9px; font-size: 13px; }
.vbar .spacer { flex: 1; }
.vbar .stats { color: var(--muted); font-size: 12px; min-width: 120px; text-align: right; }
.stage { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; background: #05080b; position: relative; }
.stage.actual { align-items: flex-start; justify-content: flex-start; }
#screen { display: block; max-width: 100%; max-height: 100%; outline: none; cursor: default; image-rendering: auto;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.touch-only { display: none; }
body.touch .touch-only { display: inline-block; }
/* Remote cursor for touch devices (the stream itself has no cursor). Tip at the element's origin. */
.rcursor { position: absolute; width: 22px; height: 22px; pointer-events: none; z-index: 2; margin: -1px 0 0 -1px;
  background: no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M1 1 L1 17 L5.5 13 L8.5 20 L11.5 18.7 L8.6 12 L14.5 12 Z' fill='white' stroke='black' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E");
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.rcursor[hidden] { display: none; }
/* Off-screen but focusable, so the phone keyboard opens for it. */
.kbd { position: fixed; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; resize: none;
  font-size: 16px; /* >=16px stops iOS zooming the page on focus */ }
body.touch .vbar { gap: 6px; }
body.touch .vbar button, body.touch .vbar select { padding: 7px 10px; }
body.touch #clipDown, body.touch #cad, body.touch #fps { display: none; }
.stage.actual #screen { max-width: none; max-height: none; }
.vbar .zoomgrp { display: inline-flex; align-items: center; gap: 0; }
.vbar .zoomgrp button { border-radius: 0; margin: 0; }
.vbar .zoomgrp button:first-child { border-radius: 6px 0 0 6px; }
.vbar .zoomgrp button:last-child { border-radius: 0 6px 6px 0; }
.vbar .zoomgrp button + button { border-left: 0; }
.vbar button.toggle[aria-pressed="true"] { background: color-mix(in srgb, var(--accent, #2f9e8f) 28%, transparent);
  border-color: var(--accent, #2f9e8f); }
#zoomLvl { min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5, 8, 11, .82); z-index: 3; }
.overlay .card { text-align: center; }
.overlay[hidden] { display: none; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--panel2);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 16px; z-index: 5; max-width: calc(100% - 32px); }
.toast[hidden] { display: none; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent2); border-radius: 50%;
  animation: spin .9s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }


/* file browser */
.files { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%); z-index: 4; display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(0,0,0,.45); }
.files[hidden] { display: none; }
.fhead, .fbar, .factions { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.fhead strong { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fbar input { flex: 1; min-width: 0; padding: 6px 9px; font-family: Consolas, "Cascadia Mono", monospace; font-size: 16px; }
.factions .muted { font-size: 12px; }
.flist { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.frow { display: grid; grid-template-columns: 24px 1fr auto; gap: 4px 10px; align-items: center; padding: 9px 12px;
  border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; -webkit-user-select: none; }
.frow:hover { background: var(--panel2); }
.frow .ic { font-size: 17px; text-align: center; }
.frow .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .meta { color: var(--muted); font-size: 12px; text-align: right; white-space: nowrap; line-height: 1.3; }
.frow.locked { opacity: .5; cursor: default; }
.fmsg { padding: 24px 14px; color: var(--muted); text-align: center; overflow-wrap: anywhere; }
.ftransfers { border-top: 1px solid var(--line); max-height: 35%; overflow-y: auto; }
.ftransfers:empty { display: none; }
.ftr { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; align-items: center; padding: 8px 12px;
  border-bottom: 1px solid var(--line); font-size: 13px; }
.ftr .nm { overflow-wrap: anywhere; }
.ftr .bar { grid-column: 1 / -1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.ftr .bar i { display: block; height: 100%; width: 0; background: var(--accent2); transition: width .2s; }
.ftr.done .bar i { background: var(--ok); width: 100% !important; }
.ftr.fail .bar i { background: var(--danger); width: 100% !important; }
.ftr button { padding: 2px 8px; font-size: 12px; }
.fdrop { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(47,158,143,.25);
  border: 2px dashed var(--accent2); font-weight: 600; pointer-events: none; }
.fdrop[hidden] { display: none; }
body.touch .frow { padding: 12px; }

/* setup values with copy buttons */
.setupvals { display: grid; grid-template-columns: max-content minmax(0, auto) max-content; gap: 6px 10px; align-items: center;
  justify-content: start; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin: 8px 0; }
.setupvals code { overflow-wrap: anywhere; user-select: all; }
.copybtn { width: 30px; height: 28px; padding: 0; display: inline-grid; place-items: center; }
.copybtn::before { content: ""; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: var(--copy-icon) center / contain no-repeat; mask: var(--copy-icon) center / contain no-repeat; }
.copybtn.done { color: var(--ok); border-color: var(--ok); }
.copybtn.done::before { -webkit-mask-image: var(--check-icon); mask-image: var(--check-icon); }
:root {
  --copy-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='5' y='5' width='9' height='9' rx='1.5'/%3E%3Cpath d='M11 5V3.5A1.5 1.5 0 0 0 9.5 2h-6A1.5 1.5 0 0 0 2 3.5v6A1.5 1.5 0 0 0 3.5 11H5'/%3E%3C/svg%3E");
  --check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.5'/%3E%3C/svg%3E");
}

/* shown when the browser won't let the page copy remote text without a tap */
.clipbar { position: fixed; top: 54px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 8px;
  max-width: min(720px, calc(100vw - 32px)); background: var(--panel2); border: 1px solid var(--accent); border-radius: 8px;
  padding: 8px 10px; box-shadow: 0 6px 24px rgba(0,0,0,.45); }
.clipbar[hidden] { display: none; }
.clipbar .cliplabel { color: var(--muted); white-space: nowrap; }
.clipbar .clippreview { font-family: Consolas, "Cascadia Mono", monospace; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.clipbar button { flex: none; }
@media (max-width: 560px) { .clipbar .cliplabel { display: none; } }
.vbar .clipinfo { color: var(--muted); font-size: 12px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.touch .vbar .clipinfo { display: none; }
.clipbar { flex-wrap: wrap; }
.clipbar .cliplabel { white-space: normal; }
.clipprog { flex-basis: 100%; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; order: 9; }
.clipprog[hidden] { display: none; }
.clipprog i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.ftr .nm.link { cursor: pointer; text-decoration: underline dotted; }

/* console: computer cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.cards .empty { grid-column: 1 / -1; padding: 28px; text-align: center; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.pc { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.pc.off { opacity: .7; }
.pc .thumb { aspect-ratio: 16 / 9; background: #05080b; display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.pc .thumb[data-connect] { cursor: pointer; }
.pc .thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pc .nothumb { color: var(--muted); font-size: 13px; }
.pcbody { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.pchead { display: flex; align-items: center; gap: 4px; }
.pchead .spacer { flex: 1; }
.small { font-size: 12px; }
.meter { display: grid; grid-template-columns: 62px 1fr auto; gap: 8px; align-items: center; font-size: 12px; }
.meter .ml { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter .mb { height: 6px; background: var(--panel2); border-radius: 3px; overflow: hidden; }
.meter .mb i { display: block; height: 100%; background: var(--accent); }
.meter .mb i.warn { background: var(--warn); }
.meter .mb i.bad { background: var(--danger); }
.meter .mt { color: var(--muted); white-space: nowrap; }
.pcactions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.pcactions .primary { flex: 1; }
/* console: history and alerts */
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tab { padding: 4px 12px; font-size: 13px; }
.tab.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.histwrap { max-height: 320px; overflow: auto; }
.hist { width: 100%; border-collapse: collapse; font-size: 13px; }
.hist th, .hist td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.hist th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--panel); }
.hist .live { color: var(--ok); }
.badtxt { color: var(--danger); }
.alertgrid { display: grid; grid-template-columns: max-content minmax(0, 420px); gap: 8px 12px; align-items: center; }
.alertgrid .row2 { display: grid; grid-template-columns: 1fr 90px; gap: 8px; }
.alertgrid .checks { display: flex; flex-direction: column; gap: 6px; }
.alertgrid .checks label { display: flex; align-items: center; gap: 6px; }
@media (max-width: 700px) {
  .hist .hide-sm { display: none; }
  .alertgrid { grid-template-columns: 1fr; }
}

/* viewer: tools */
.morewrap { position: relative; }
.menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 6; min-width: 290px; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 8px; padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.menu[hidden] { display: none; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 6px; }
.menu button:hover { background: var(--panel); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--accent); color: var(--accent2); }
.badge.warn { border-color: var(--warn); color: var(--warn); }
.badge[hidden] { display: none; }
.vbar button.attn { border-color: var(--warn); color: var(--warn); }
.side .fhead select { padding: 3px 6px; font-size: 12px; }
.chatlog { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.cmsg { max-width: 90%; }
.cmsg .cwho { font-weight: 600; font-size: 12px; }
.cmsg .ctime { color: var(--muted); font-size: 11px; }
.cmsg .ctext { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--panel2); border-radius: 8px; padding: 6px 10px; margin-top: 2px; }
.cmsg.me { align-self: flex-end; }
.cmsg.me .ctext { background: color-mix(in srgb, var(--accent) 30%, var(--panel2)); }
.cmsg.them .cwho { color: var(--accent2); }
.cmsg.err .ctext { color: var(--danger); }
.cmsg.sys { align-self: center; color: var(--muted); font-size: 12px; text-align: center; }
.chatform { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chatform input { flex: 1; }
.term { width: min(760px, 100%); }
.termout { flex: 1; margin: 0; padding: 10px 12px; overflow: auto; background: #0a0e12; color: #d7dde4;
  font: 12.5px/1.45 Consolas, "Cascadia Mono", monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.termout .tprompt { color: var(--accent2); }
.termout .tcmd { color: #fff; }
.termout .tinfo { color: var(--muted); }
.termout .terr { color: var(--danger); }
.termline { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-top: 1px solid var(--line);
  background: #0a0e12; font: 12.5px Consolas, "Cascadia Mono", monospace; }
.termline span { color: var(--accent2); white-space: nowrap; padding-top: 5px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.termline textarea { flex: 1; resize: vertical; min-height: 26px; background: transparent; border: 1px solid var(--line);
  color: #fff; font: inherit; padding: 4px 6px; }

/* viewer: recording / view-only, phone key bar */
.badge.rec { border-color: var(--danger); color: var(--danger); }
body.viewonly #filesBtn, body.viewonly #clipSync, body.viewonly #clipInfo, body.viewonly #clipUp, body.viewonly #clipDown,
body.viewonly #sas, body.viewonly #cad, body.viewonly #win, body.viewonly .morewrap, body.viewonly #kbdBtn,
body.viewonly #escBtn, body.viewonly #keybarBtn, body.viewonly #touchMode { display: none !important; }
.keybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; gap: 6px; padding: 6px 8px;
  overflow-x: auto; background: var(--panel); border-top: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.keybar[hidden] { display: none; }
.keybar button { flex: none; min-width: 44px; padding: 9px 10px; font-size: 14px; }
.keybar button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 30%, transparent); }
.keybar button.locked { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 30%, transparent); }

/* console: admin pieces */
body.not-admin .admin-only { display: none !important; }
.pcsettings { display: flex; flex-direction: column; gap: 6px; font-size: 13px; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 4px; }
.pcsettings label { display: flex; gap: 6px; align-items: flex-start; }
.recset { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 10px; font-size: 13px; }
.recset[hidden] { display: none; }
.userform { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.userform h3 { font-size: 14px; margin: 0 0 10px; }
.devchecks { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto; }
.nowrap { white-space: nowrap; }

/* phones: the session area handles its own touch gestures (no page zoom or scroll) */
#stage { touch-action: none; overscroll-behavior: contain; }

/* console: host updates */
.updset { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 0 0 12px; font-size: 13px; }
.updating { color: var(--warn); }
button.tiny { padding: 1px 8px; font-size: 12px; }

/* console: Manage window, run panel */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.mwin { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: min(980px, 100%); height: min(760px, 100%);
  display: flex; flex-direction: column; overflow: hidden; }
.mhead { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mhead .mtabs { margin: 0; flex: 1; flex-wrap: wrap; }
.mbody { flex: 1; overflow: auto; padding: 12px 14px; }
.mbody h3 { font-size: 14px; margin: 14px 0 6px; }
.mmsg { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 20px 0; }
.mmsg .spinner, #wuOut .spinner { width: 18px; height: 18px; border-width: 2px; display: inline-block; vertical-align: middle; margin: 0; }
.mbar { display: flex; gap: 8px; margin-bottom: 8px; }
.mbar input { flex: 1; }
.kv { border-collapse: collapse; font-size: 13px; width: 100%; }
.kv th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 12px 6px 0; vertical-align: top; white-space: nowrap; width: 1%; }
.kv td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.oktxt { color: var(--ok); }
.jobout { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; max-height: 360px; overflow: auto;
  font: 12px/1.4 Consolas, "Cascadia Mono", monospace; white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0; }
.runform { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.runform textarea { font: 12.5px Consolas, "Cascadia Mono", monospace; resize: vertical; }
.runopts { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 13px; }
.devchecks.inline { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; max-height: none; }
#rResults details { margin: 6px 0; }
#rResults summary { cursor: pointer; }

/* viewer: pointer and pen palette */
.annot { display: inline-flex; gap: 4px; padding: 2px 4px; border: 1px solid var(--danger); border-radius: 8px; }
.annot[hidden] { display: none; }
.annot button { padding: 3px 8px; font-size: 12px; }

/* console: quick support */
.supitem { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: center;
  padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.supcode { font-size: 20px; font-weight: 700; color: var(--accent2); margin-right: 12px; letter-spacing: 1px; }
.suplink { display: flex; gap: 6px; align-items: center; }

/* console: Linux servers (terminal only) */
.nothumb.termthumb { font: 700 34px ui-monospace, Consolas, monospace; color: var(--accent2); background: #05080b;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.nothumb.termthumb span { font: 12px system-ui, sans-serif; color: var(--muted); }
.setupvals.linuxcmd { grid-template-columns: minmax(0, 1fr) max-content; }
.setupvals.linuxcmd code { background: #05080b; padding: 8px 10px; border-radius: 6px; font-size: 12px; }

/* console: round 5 */
.healthbar { background: #4a1d1d; border: 1px solid #a33; color: #ffd7d7; border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; }
.healthbar[hidden] { display: none; }
.schedform { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 12px; align-items: center; margin: 10px 0 4px;
  padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); }
.schedform textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.schedform .days label { margin-right: 10px; white-space: nowrap; }
.schedform .wide { grid-column: 1 / -1; }
@media (max-width: 700px) { .schedform { grid-template-columns: 1fr; } }
.schedlast details { margin-top: 4px; }
.schedlast pre { max-height: 220px; }
.weblinks button { margin: 0 6px 6px 0; }
.dockrow td { vertical-align: top; }

/* ---- session toolbar (round 6): a few clear buttons, the rest in menus ---- */
.vbar { flex-wrap: nowrap; gap: 6px; padding: 6px 10px; min-height: 48px; }
.vbar .vtitle { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; margin-right: 4px; }
.vbar .vtitle .name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.vbar .vtitle .stats { min-width: 0; text-align: left; font-size: 11px; white-space: nowrap; }
.vbar .vsep { width: 1px; height: 26px; background: var(--line); margin: 0 4px; flex: none; }
.vbar .tb { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 8px; background: transparent;
  border: 1px solid transparent; font-size: 13px; color: var(--text); white-space: nowrap; flex: none; }
.vbar .tb:hover { background: var(--panel2); border-color: var(--line); }
.vbar .tb i { font-style: normal; font-size: 15px; line-height: 1; }
.vbar .tb b { font-weight: normal; color: var(--muted); font-size: 10px; margin-left: -2px; }
.vbar .tb.toggle[aria-pressed="true"], .vbar .tb.on { background: color-mix(in srgb, var(--accent) 22%, transparent);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.vbar #disconnect { flex: none; margin-left: 6px; padding: 6px 12px; }
.vbar .badge { flex: none; white-space: nowrap; }
.vbar .annot { display: inline-flex; gap: 4px; flex: none; }
.menuwrap { position: relative; flex: none; }
.menu.menuright { left: auto; right: 0; }
.menu .clipinfo { color: var(--muted); font-size: 12px; padding: 2px 10px 6px; max-width: 320px; white-space: normal; }
.menu .clipinfo:empty { display: none; }
.menu.menuform { min-width: 300px; padding: 8px; }
.menu .mrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 4px; }
.menu .mrow > span:first-child { color: var(--muted); font-size: 13px; }
.menu .mrow select { padding: 5px 8px; font-size: 13px; max-width: 200px; }
.menu .mrow[hidden] { display: none; }
.menu .zoomgrp { display: inline-flex; }
.menu .zoomgrp button { display: inline-block; width: auto; border: 1px solid var(--line); background: var(--panel); padding: 5px 10px;
  border-radius: 0; margin: 0; }
.menu .zoomgrp button:first-child { border-radius: 6px 0 0 6px; }
.menu .zoomgrp button:last-child { border-radius: 0 6px 6px 0; }
.menu .zoomgrp button + button, .menu .zoomgrp select + button { border-left: 0; }
.menu .zoomgrp select { border-radius: 0; border-left: 0; }
.menu button.toggle[aria-pressed="true"] { color: var(--accent2); }
.touch-only-block { display: none; }
body.touch .touch-only-block { display: block; }
body.touch #clipDown, body.touch #cad, body.touch #fps { display: revert; }
/* narrower windows: icons only for the main buttons */
@media (max-width: 1100px) { .vbar .tb span { display: none; } .vbar .tb { padding: 6px 9px; } }
@media (max-width: 700px) {
  .vbar { gap: 2px; padding: 6px; }
  .vbar .vtitle .name { max-width: 110px; font-size: 14px; }
  .vbar .vtitle .stats, .vbar .badge, .vbar .vsep { display: none; }
  .vbar .tb { padding: 7px; }
  .vbar #disconnect { padding: 6px 8px; font-size: 12px; }
}
body.touch .vbar .tb { padding: 8px 10px; }
/* toolbar tucked away */
body.barhidden .vbar { display: none; }
.showbar { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 7; border-radius: 0 0 10px 10px;
  border-top: 0; padding: 3px 14px; font-size: 12px; opacity: .55; background: var(--panel); }
.showbar:hover { opacity: 1; }
.showbar[hidden] { display: none; }
body.viewonly [data-menu="keysMenu"], body.viewonly #clipMenuBtn, body.viewonly .menuwrap:has(#clipMenu) { display: none !important; }
.vbar .tb.touch-only { display: none; }
body.touch .vbar .tb.touch-only { display: inline-flex; }
.vbar .annot[hidden] { display: none; }
.menu .zoomgrp button { background: var(--bg); border-color: #3a4757; min-width: 34px; text-align: center; }
.menu .zoomgrp button:hover { border-color: var(--accent); }
.menu .zoomgrp select { background: var(--bg); border-color: #3a4757; }
.narrow-only, #disconnect .short { display: none; }
@media (max-width: 700px) {
  .vbar .wide-only { display: none !important; }
  .narrow-only { display: block; }
  #disconnect .full { display: none; } #disconnect .short { display: inline; }
  .vbar .vtitle .name { max-width: 96px; }
  .menu { min-width: min(290px, calc(100vw - 16px)); }
}

/* ---- console (round 6): pages with a top navigation, quieter cards ---- */
header.top { position: sticky; top: 0; z-index: 8; flex-wrap: nowrap; }
header.top .nav { display: flex; gap: 2px; flex: 1; justify-content: center; overflow-x: auto; scrollbar-width: none; }
header.top .nav::-webkit-scrollbar { display: none; }
header.top .nav a { color: var(--muted); text-decoration: none; padding: 7px 12px; border-radius: 8px; white-space: nowrap; font-size: 14px; }
header.top .nav a:hover { color: var(--text); background: var(--panel2); }
header.top .nav a.on { color: var(--text); background: color-mix(in srgb, var(--accent) 22%, transparent); }
header.top .who { display: flex; align-items: center; gap: 10px; flex: none; }
body.not-admin header.top .nav a.admin-only { display: none; }
[data-pg][hidden] { display: none !important; }
main.console > section.panel:first-of-type, main.console [data-pg] > .toolbar:first-child { margin-top: 0; }
main.console section.panel { margin-top: 0; margin-bottom: 18px; }
.toolbar #q { flex: 1; min-width: 180px; max-width: 360px; }
.toolbar .spacer { flex: 1; }
.chips { display: inline-flex; gap: 4px; }
.chips button { border-radius: 16px; padding: 4px 12px; font-size: 13px; background: transparent; }
.chips button.on { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.pc .pchead { gap: 6px; }
.pc .pchead b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--panel2); color: var(--muted); white-space: nowrap;
  max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.pill.on { color: #7ee2b8; background: color-mix(in srgb, #2ea86b 18%, transparent); }
.pill.busy { color: #f2c46d; background: color-mix(in srgb, #d99a1e 18%, transparent); }
.pcos { margin: -2px 0 4px; }
.pcactions { align-items: center; }
.cmwrap { position: relative; }
.cardmenu { min-width: 230px; bottom: calc(100% + 4px); top: auto; }
@media (max-width: 760px) {
  header.top { flex-wrap: wrap; padding: 10px 12px 0; gap: 8px; }
  header.top .brand { order: 1; }
  header.top .who { order: 2; margin-left: auto; }
  header.top .who #me { display: none; }
  header.top .nav { order: 3; flex-basis: 100%; justify-content: flex-start; padding-bottom: 6px; }
  .toolbar #q { max-width: none; flex-basis: 100%; }
}
.pc.off .thumb { aspect-ratio: auto; height: 0; border-bottom: 0; }
.pc.off .thumb > * { display: none; }
.pc.off { opacity: .8; }
.pc.off:hover { opacity: 1; }
.pcactions .spacer { flex: 1; }
.cards { align-items: start; }

/* ---- round 7: groups, notes, temporary access, inventory, Google/Microsoft sign-in, sharing control ---- */
.tagrow { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 2px 0 4px; }
.tag { font-size: 11px; padding: 1px 8px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text); line-height: 18px; white-space: nowrap; }
button.tag { cursor: pointer; }
button.tag:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.grpick { margin: 0 0 6px; }
.pcnotes { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 0 4px; }
.pcnotes[data-info] { cursor: pointer; }
.pcnotes[data-info]:hover { color: var(--text); }
#grp { border-radius: 16px; padding: 4px 10px; font-size: 13px; max-width: 180px; }
#grp.on { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.mwin.infowin { width: min(560px, 100%); height: auto; max-height: 100%; }
.infowin .mbody { display: flex; flex-direction: column; gap: 6px; padding: 14px; }
.infowin label { font-weight: 600; margin-top: 6px; }
.infowin textarea { width: 100%; resize: vertical; font: inherit; }
.guestbar { margin: 0 0 14px; padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--warn) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); }
body.guest header.top .nav a:not([data-page="computers"]):not([data-page="activity"]) { display: none; }
.ssorow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; }
.ssorow b { min-width: 90px; }
.ssoform { margin-top: 10px; }
.ssoform h3 { font-size: 14px; margin: 6px 0 8px; }
.copyrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copyrow code { word-break: break-all; background: var(--panel2); padding: 4px 8px; border-radius: 6px; font-size: 12px; }
.invres { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.btnrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ctlbar { z-index: 12; }
#ctlBtn[hidden] { display: none; }
.ssodiv { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 14px 0 10px; }
.ssodiv::before, .ssodiv::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.ssobtn { display: block; margin-top: 8px; }
.devchecks .grpick { flex-basis: 100%; margin: 0 0 2px; }

/* computer cards: clearer box around each one */
.cards { gap: 22px 18px; }
.pc { background: var(--panel2); border: 1px solid #3d4b5b; border-top: 3px solid var(--ok);
  box-shadow: 0 2px 4px rgba(0,0,0,.45), 0 8px 22px rgba(0,0,0,.35); transition: border-color .15s, box-shadow .15s; }
.pc.off { border-top-color: #56626f; }
.pc:hover { border-color: #566679; box-shadow: 0 2px 4px rgba(0,0,0,.5), 0 10px 28px rgba(0,0,0,.45); }
.pc .thumb { border-bottom-color: #3d4b5b; }
.pc .meter .mb { background: var(--bg); }

/* round 8: passkeys, installed app, restore */
.pkbtn { width: 100%; margin-top: 8px; }
.subh { font-size: 14px; margin: 16px 0 4px; }
#appInstall p { margin: 0 0 6px; }
dialog.rdlg { padding: 0; border: 0; background: transparent; color: var(--text); width: min(480px, calc(100% - 32px)); }
dialog.rdlg::backdrop { background: rgba(0,0,0,.55); }
dialog.rdlg .mwin { width: 100%; height: auto; }
dialog.rdlg .mbody { padding: 14px 16px; }
dialog.rdlg input { width: 100%; }

/* anything marked hidden stays hidden, whatever its own display style */
[hidden] { display: none !important; }

/* ---- round 9: approvals, health, software ---- */
.dot.bad { background: var(--danger); }
.approvebar { border-color: var(--warn); margin-bottom: 14px; }
.approvebar h3 { margin: 0 0 4px; color: var(--warn); font-size: 15px; }
.apprlist { display: flex; flex-direction: column; gap: 10px; }
.appr { display: flex; gap: 12px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; flex-wrap: wrap; }
.apthumb { width: 120px; height: 68px; border-radius: 6px; overflow: hidden; background: var(--bg); display: grid; place-items: center; flex: none; color: var(--muted); font-size: 12px; }
.apthumb img { width: 100%; height: 100%; object-fit: cover; }
.apinfo { flex: 1; min-width: 180px; }
.apbtns { display: flex; gap: 8px; }
.hwarn { font-size: 11px; padding: 2px 8px; border-radius: 10px; margin-right: 6px; color: #f2c46d; border: 1px solid color-mix(in srgb, var(--warn) 60%, transparent);
  background: color-mix(in srgb, var(--warn) 14%, transparent); cursor: pointer; white-space: nowrap; }
.hwarn:disabled { cursor: default; opacity: 1; }
.mbody { position: relative; }
.hbar { align-items: center; flex-wrap: wrap; }
.hissues { margin: 6px 0 0; padding: 8px 12px; list-style: none; border-radius: 8px; color: #f2c46d; background: color-mix(in srgb, var(--warn) 12%, transparent); }
.hissues li { margin: 2px 0; }
.hcharts { display: grid; gap: 12px; margin-top: 12px; }
.hchart { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px 4px; }
.hchart figcaption { font-size: 13px; font-weight: 600; margin-bottom: 4px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.hchart canvas { width: 100%; height: 120px; display: block; }
.hlegend { display: inline-flex; gap: 12px; font-weight: 400; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.hlegend i, .htip i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.htip { position: absolute; z-index: 5; pointer-events: none; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 9px; font-size: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.4); white-space: nowrap; }
.svcwatch { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.svcchip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border: 1px solid var(--line); border-radius: 16px; font-size: 13px; background: var(--panel2); }
.svcchip .dot { margin-right: 4px; }
.svcchip button { padding: 0 6px; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.pkg { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 10px; background: var(--panel2); }
.pkg.open { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.pkgrow { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.pkgname { flex: 1; min-width: 220px; word-break: break-word; }
.pkgres { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }
.pkgform { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.pkgform .mbar { margin-bottom: 8px; }
