/* ============================================================================================
   AIO Control — panel styles. Light theme by default, [data-theme=dark] on <html> for dark.
   ============================================================================================ */
/* Brand palette "Shield Turquoise" (branding/tokens.css): night blue and turquoise, from the icon. Turquoise sits close to
   the green "connected" status, so a status is never shown by colour alone: every dot comes with a label or an icon. */
:root {
  --bg: #F1F7F7;
  --surface: #FFFFFF;
  --surface-2: #E6F1F1;
  --hover: #EAF4F4;
  --border: #D5E5E5;
  --border-strong: #6E8A8C;
  --text: #0A1A1E;
  --muted: #4F6669;
  --primary: #0B7A75;
  --primary-hover: #09625E;
  --primary-soft: #DDF5F2;
  --primary-border: #94D9D0;
  --on-primary: #ffffff;
  --link: #0B6F6A;                 /* brand colour as text on a surface */
  --primary-soft-text: #0A5C57;
  --brand-accent: #3EE0C4;         /* decoration only (active nav marker); never a status and never behind text */
  --success-text: #166534;         /* status TEXT on its soft background; --success / --danger / --warning are for dots and icons */
  --danger-text: #B91C1C;
  --info: #1D4ED8;
  --info-soft: #DBEAFE;
  --danger: #DC2626;
  --danger-hover: #B91C1C;
  --danger-soft: #FEE2E2;
  --success: #16A34A;
  --success-soft: #DCFCE7;
  --warning: #D97706;
  --warning-soft: #FEF3C7;
  --warning-text: #92400E;
  --violet: #7c3aed;
  --violet-soft: #f1eafe;
  --grey: #8FA3A5;
  --badge-bg: #E6F1F1;
  --input-bg: #FFFFFF;
  --code-bg: #0A1B2E;
  --code-text: #DDF0F0;
  --toast-bg: #0A1B2E;
  --scrim: rgba(6, 20, 28, .5);

  --sidebar-bg: #0A1B2E;
  --sidebar-bg-2: #0E5A5E;
  --sidebar-text: #DDF0F0;
  --sidebar-muted: #A3C4C6;
  --sidebar-hover: rgba(255, 255, 255, .08);
  --sidebar-active: rgba(62, 224, 196, .18);
  --sidebar-active-text: #A6F4E6;
  --sidebar-fill: linear-gradient(165deg, #0A1B2E 0%, #0E3A4C 55%, #0E5A5E 100%);   /* the side menu: night blue into turquoise */
  --primary-fill: linear-gradient(100deg, #0B7A75, #1A6FC0);                       /* the main button */
  --sidebar-border: rgba(255, 255, 255, .07);

  /* tile "screens" */
  --screen-user: linear-gradient(140deg, #163E63 0%, #0E7C86 60%, #16A69A 100%);
  --screen-idle: linear-gradient(140deg, #3B4A52 0%, #55656D 100%);
  --screen-off: linear-gradient(140deg, #121C22 0%, #1E2A30 100%);
  --screen-bezel: #0B1726;
  --tile-selected-bg: #E3F5F2;

  /* design system: one spacing scale, one control height, one radius family */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px;
  --ctl-h: 36px;
  --ctl-h-sm: 30px;
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 15.5px; --fs-xl: 18px; --fs-2xl: 22px;
  --ring: 0 0 0 3px color-mix(in srgb, var(--primary) 28%, transparent);
  --ease: cubic-bezier(.2, .7, .3, 1);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .08);
  --mono: Consolas, "Cascadia Mono", "Courier New", monospace;
  --rail-w: 78px;
  --sidebar-w: 350px;          /* the rail and the panel beside it */
  --rail-bg: #071423;

  color-scheme: light;
  font-family: "Segoe UI", "Segoe UI Variable", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}

:root[data-theme=dark] {
  --bg: #0A100E;
  --surface: #121A17;
  --surface-2: #1A2521;
  --hover: #202D28;
  --border: #28362F;
  --border-strong: #76897F;
  --text: #F1EEDF;
  --muted: #A8B5A8;
  --primary: #8EE86A;
  --primary-hover: #A9F08C;
  --primary-soft: #173322;
  --primary-border: rgba(142, 232, 106, .42);
  --on-primary: #07180B;           /* dark text on the bright green button */
  --link: #A9F08C;
  --primary-soft-text: #C9F7B6;
  --brand-accent: #C8F560;
  --success-text: #4ADE80;
  --danger-text: #F87171;
  --info: #7DB2FF;
  --info-soft: #10233F;
  --sidebar-text: #D3E6DC;
  --sidebar-active: rgba(200, 245, 96, .15);
  --danger: #EF4444;
  --danger-hover: #DC2626;
  --danger-soft: #3A1414;
  --success: #22C55E;
  --success-soft: #0F2E1D;
  --warning: #F59E0B;
  --warning-soft: #33260A;
  --warning-text: #FBBF24;
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, .15);
  --grey: #66756C;
  --badge-bg: #1D2924;
  --input-bg: #0D1411;
  --code-bg: #060A08;
  --code-text: #DCE9E0;
  --toast-bg: #202D28;
  --scrim: rgba(0, 0, 0, .6);

  --sidebar-bg: #081712;
  --sidebar-bg-2: #0C3F3D;
  --sidebar-fill: linear-gradient(165deg, #081712 0%, #0D2B26 55%, #0C3F3D 100%);
  --primary-fill: linear-gradient(100deg, #C2F542, #2DD4BF);
  --sidebar-active-text: #E7FBB5;
  --sidebar-border: rgba(255, 255, 255, .06);

  --screen-user: linear-gradient(140deg, #12402F 0%, #0B7A75 55%, #0F7F78 100%);
  --screen-idle: linear-gradient(140deg, #1C2824 0%, #2A3833 100%);
  --screen-off: linear-gradient(140deg, #070B09 0%, #0D1411 100%);
  --screen-bezel: #050807;
  --tile-selected-bg: #15291F;

  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
body.loading .app { visibility: hidden; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 22px; letter-spacing: -.01em; }
h2 { font-size: 15.5px; }
h3 { font-size: 14px; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }
svg.icon { width: 18px; height: 18px; flex: none; display: block; }

/* ============================================================================================
   Shell: sidebar (right in RTL) + workspace
   ============================================================================================ */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
/* The side menu is two columns: the rail (one button per area, always in sight) and the panel beside it, which shows
   the area that is open. The panel can be put away on a computer; the rail stays. */
.sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 40;
  display: flex; flex-direction: row;
  background: var(--sidebar-fill);
  color: var(--sidebar-text);
  border-inline-end: 1px solid var(--sidebar-border);
}
.rail {
  width: var(--rail-w); flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 0 12px; background: var(--rail-bg); border-inline-end: 1px solid rgba(255, 255, 255, .06);
}
.rail-logo { display: block; margin-bottom: 12px; border-radius: 11px; }
.rail-logo img { display: block; width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
.rail-logo:focus-visible { outline: none; box-shadow: var(--ring); }
.rail-btn {
  position: relative; width: 64px; padding: 8px 0 7px; border: 0; border-radius: 12px; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--sidebar-muted); font: inherit; font-size: 11px; font-weight: 600; line-height: 1.15; white-space: nowrap;
  transition: background-color .12s, color .12s;
}
.rail-btn svg.icon { width: 22px; height: 22px; }
.rail-btn:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
a.rail-btn { text-decoration: none; margin-bottom: 6px; }
.rail-btn:focus-visible { outline: none; box-shadow: var(--ring); }
/* the area shown in the panel */
.rail-btn.on { background: var(--sidebar-active); color: var(--sidebar-active-text); }
.rail-btn.on svg.icon { color: var(--brand-accent); }
/* the area of the page that is open: a marker on the outer edge */
.rail-btn.here::before {
  content: ""; position: absolute; inset-inline-start: -6px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--brand-accent);
}
.rail-badge {
  position: absolute; top: 3px; inset-inline-end: 9px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
  background: #F59E0B; color: #2A1800; box-shadow: 0 0 0 2px var(--rail-bg);
}
.rail-badge.ok { background: #3EE0C4; color: #05222A; }
.rail-badge[hidden] { display: none; }
.rail-space { flex: 1; min-height: 8px; }
.rail-conn { display: grid; place-items: center; width: 28px; height: 22px; }
.rail-conn .dot { width: 9px; height: 9px; }
.rail-me { position: relative; }
.rail-avatar {
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  display: grid; place-items: center; font: inherit; font-weight: 700; font-size: 15px;
  background: linear-gradient(140deg, #0E7C86, #3EE0C4); color: #05222A;
}
.rail-avatar:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--rail-bg), 0 0 0 5px var(--brand-accent); }
.me-menu {
  position: absolute; bottom: 0; inset-inline-start: calc(100% + 12px); z-index: 60; min-width: 230px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 6px; display: flex; flex-direction: column;
}
.me-menu[hidden] { display: none; }
.me-head { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.me-head .who { font-weight: 700; font-size: 14.5px; }
.me-conn { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.me-item {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border: 0; border-radius: 9px; background: none;
  font: inherit; font-size: 14px; color: var(--text); cursor: pointer; text-align: start;
}
.me-item svg.icon { width: 17px; height: 17px; color: var(--muted); }
.me-item:hover, .me-item:focus-visible { background: var(--hover); outline: none; }
.me-item.danger, .me-item.danger svg.icon { color: var(--danger-text); }
.me-item[hidden] { display: none; }
.visually-hidden { position: absolute !important; top: 0; inset-inline-start: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.side-panel {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 0 0 12px;
  overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
}
.panel-head { display: flex; align-items: center; gap: 8px; padding: 18px 12px 10px 18px; }
.panel-title { flex: 1; margin: 0; font-size: 18px; font-weight: 700; color: #fff; letter-spacing: -.01em; }
.panel-close svg.icon { width: 18px; height: 18px; color: var(--sidebar-muted); transform: rotate(-90deg); }
/* put away: only the rail is left (a computer only; on a phone the whole menu slides in and out) */
@media (min-width: 1181px) {
  .app.panel-away { --sidebar-w: var(--rail-w); }
  .app.panel-away .side-panel { display: none; }
}
@media (max-width: 1180px) { .panel-head .panel-close { display: none; } }
.pane { padding: 0 10px; }
.pane[hidden] { display: none; }
.pane-sub {
  display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .06em; color: var(--sidebar-muted);
}
.pane-sub > span:first-child { flex: 1; }

/* The place (school, office, home) the panel is narrowed to: a switcher above the rooms. */
.side-place { padding: 0 10px 6px; }
.side-place:empty { display: none; }
.place-dd { display: block; }
.place-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06); color: #fff;
  font-family: inherit; font-size: 14px; font-weight: 600; text-align: start;
}
.place-btn > span:not(.dd-chev) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-btn svg.icon { width: 18px; height: 18px; color: var(--brand-accent); flex: none; }
.place-btn .dd-chev svg.icon { color: var(--sidebar-muted) !important; }
.place-btn:hover, .side-place .place-dd.open .place-btn { background: var(--sidebar-hover); border-color: rgba(255, 255, 255, .22); }
/* A page of the whole hub (updates, activity log, alerts) opened while narrowed to one place says so. */
.place-note { display: inline-flex; align-items: center; gap: 5px; margin-inline-start: 12px; padding: 3px 10px; border-radius: 999px; background: var(--primary-soft); border: 1px solid var(--primary-border); color: var(--primary-soft-text); font-size: 12.5px; font-weight: 600; letter-spacing: 0; vertical-align: middle; white-space: nowrap; cursor: help; }
.place-note svg.icon { width: 13px; height: 13px; }
.place-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.place-dd .dd-menu { inset-inline: 0; min-width: 0; }
.place-dd .menu-item.current { font-weight: 600; }
.place-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.place-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; flex-wrap: wrap; }
.place-row.current { border-color: var(--primary-border); background: var(--primary-soft); }
.place-row-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 160px; }
.place-row-text strong { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.place-add { display: flex; gap: 8px; flex-wrap: wrap; }
.place-add input { flex: 1; min-width: 200px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-rooms .side-nav a { flex: none; }
.side-rooms .side-nav { margin-inline: -10px; padding-inline: 10px; }

/* ---- the rooms tree: arrow, room, and under an open room its rooms and its computers with tick boxes ---- */
.room-tree { gap: 1px; }
.rt-row { display: flex; align-items: center; gap: 2px; }
.side-rooms .rt-row > a { flex: 1 1 auto; min-width: 0; }
.room-tree a.active::before { display: none; }
.rt-chev {
  flex: none; width: 22px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: none; cursor: pointer;
  display: grid; place-items: center; color: var(--sidebar-muted);
}
.rt-chev svg.icon { width: 14px; height: 14px; transform: rotate(90deg); transition: transform .15s; }
.rt-chev[aria-expanded="true"] svg.icon { transform: none; }
.rt-chev:hover { background: var(--sidebar-hover); color: #fff; }
.rt-chev:focus-visible { outline: none; box-shadow: var(--ring); }
.rt-chev.none { visibility: hidden; }
.rt-body { display: flex; flex-direction: column; gap: 1px; margin-inline-start: 11px; padding-inline-start: 6px; border-inline-start: 1px solid rgba(255, 255, 255, .12); }
.rt-body[hidden] { display: none; }
.rt-kids, .rt-pcs { display: flex; flex-direction: column; gap: 1px; }
.rt-kids:empty, .rt-pcs:empty { display: none; }
.rt-body .rt-row > a { padding-block: 6px; font-size: 13.5px; }
.rt-body .rt-row > a svg.icon { width: 15px; height: 15px; }
.rt-pc {
  display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 4px 8px; border-radius: 8px; cursor: pointer;
  color: var(--sidebar-text); font-size: 13px;
}
.rt-pc[hidden] { display: none; }
.rt-pc:hover { background: var(--sidebar-hover); color: #fff; }
.rt-pc input { flex: none; width: 15px; height: 15px; margin: 0; accent-color: #5EEAD4; cursor: pointer; }
.rt-pc input:focus-visible { outline: none; box-shadow: var(--ring); }
.rt-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .28); }
.rt-dot.on { background: #4ADE80; }
.rt-pc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.rt-pc.off .rt-pc-name { color: var(--sidebar-muted); opacity: .75; }
.rt-all { color: var(--sidebar-muted); font-size: 12.5px; }
.rt-hidden-mark { display: inline-flex; color: #FCD34D; }
.rt-hidden-mark[hidden] { display: none; }
.side-nav a .rt-hidden-mark svg.icon { width: 15px; height: 15px; color: #FCD34D; }
.rt-note {
  display: flex; align-items: center; gap: 6px; margin: 6px 0 2px; padding: 6px 6px 6px 10px; border-radius: 8px;
  background: rgba(251, 191, 36, .12); color: #FCD34D; font-size: 12.5px;
}
.rt-note[hidden] { display: none; }
.rt-note svg.icon { width: 15px; height: 15px; flex: none; }
.rt-note-btn {
  margin-inline-start: auto; border: 0; border-radius: 999px; padding: 3px 10px; cursor: pointer;
  background: rgba(255, 255, 255, .12); color: #fff; font: inherit; font-weight: 600;
}
.rt-note-btn:hover { background: rgba(255, 255, 255, .2); }
.rt-note-btn:focus-visible { outline: none; box-shadow: var(--ring); }
@media (max-width: 760px) {
  .rt-chev { width: 32px; height: 38px; }
  .rt-chev svg.icon { width: 16px; height: 16px; }
  .rt-pc { min-height: 38px; font-size: 14px; }
  .rt-pc input { width: 18px; height: 18px; }
  .rt-note-btn { min-height: 32px; }
  .rt-body .rt-row > a { padding-block: 9px; }
}
.side-nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--sidebar-text); font-size: 14px; position: relative;
}
.side-nav a svg.icon { width: 18px; height: 18px; color: var(--sidebar-muted); }
.side-nav a:hover { background: var(--sidebar-hover); text-decoration: none; color: #fff; }
.side-nav a:hover svg.icon { color: #D6E7E4; }
.side-nav a.active { background: var(--sidebar-active); color: var(--sidebar-active-text); font-weight: 600; }
.side-nav a.active svg.icon { color: var(--brand-accent); }
.side-nav a.active::before {
  content: ""; position: absolute; inset-inline-start: -10px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand-accent);
}
.side-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A page of the panel: icon, name, and one short line on what it is for. */
.static-nav a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ic name count" "ic desc count"; column-gap: 11px; row-gap: 1px; padding: 9px 10px; border-radius: 10px; }
.static-nav a > svg.icon { grid-area: ic; align-self: start; margin-top: 1px; width: 19px; height: 19px; }
.static-nav a > .side-label { grid-area: name; font-weight: 600; }
.static-nav a > .side-desc { grid-area: desc; font-size: 12px; color: var(--sidebar-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.static-nav a > .side-count { grid-area: count; align-self: center; }
.static-nav a.active > .side-desc { color: color-mix(in srgb, var(--sidebar-active-text) 70%, var(--sidebar-muted)); }
.static-nav a.active::before { inset-inline-start: -10px; top: 10px; bottom: 10px; }
.side-count {
  font-size: 12px; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate;
  padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--sidebar-muted);
}
.side-count.has-online { color: #86efac; background: rgba(34, 197, 94, .12); }

.conn { display: inline-flex; align-items: center; gap: 8px; color: var(--sidebar-muted); font-size: 12.5px; }
.conn .dot { width: 8px; height: 8px; }
.conn .dot.on { box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.conn.bad { color: #fca5a5; }

.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; flex: none;
  border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0;
}
.icon-btn:hover { background: var(--hover); }
.icon-btn[hidden] { display: none; }
.sidebar .icon-btn { color: var(--sidebar-text); }
.sidebar .icon-btn:hover { background: var(--sidebar-hover); color: #fff; }
.icon-btn.small { width: 24px; height: 24px; border-radius: 6px; }
.icon-btn.small svg.icon { width: 14px; height: 14px; }

.workspace { min-width: 0; display: flex; flex-direction: column; }
/* On a computer the page scrolls inside the workspace, not the window: a scrolling box in a right-to-left page keeps
   its scroll bar on the left, away from the side menu (the window's own bar stays on the right in Chrome and Edge).
   Phones and tablets keep the window scrolling, for the browser's own bars and pull-to-refresh. */
@media (min-width: 1181px) {
  .app { height: 100vh; overflow: hidden; }
  .workspace { height: 100vh; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable;
    scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
  /* The side menu scrolls as one box, not a box inside a box, and its bar shows only while the pointer is on the
     menu, so the page has one scroll bar in sight: the workspace's, on the left. */
  .side-panel { scrollbar-color: transparent transparent; }
  .side-panel:hover, .side-panel:focus-within { scrollbar-color: rgba(255,255,255,.22) transparent; }
}
.mobilebar { display: none; }
.scrim { display: none; }
.main { padding: 22px 26px 40px; width: 100%; max-width: 1920px; }


/* ============================================================================================
   Generic: cards, buttons, inputs, tables, badges
   ============================================================================================ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 16px 20px; }
.card-head { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 16px; }
.tile { padding: 16px 20px; }
.tile .label { color: var(--muted); font-size: 13px; }
.tile .value { font-size: 28px; font-weight: 600; margin-top: 4px; }
.tile.online .value { color: var(--success); }
.tile.offline .value { color: var(--grey); }
.tile.uwf .value { color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center; flex: none;
  height: var(--ctl-h); padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-md); font-weight: 550; line-height: 1;
  cursor: pointer; white-space: nowrap; box-shadow: 0 1px 1px rgba(16, 24, 40, .04);
  transition: background-color .12s, border-color .12s, color .12s, box-shadow .12s;
}
.btn:hover { background: var(--hover); border-color: var(--border-strong); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--primary); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary-fill) border-box; border-color: transparent; color: var(--on-primary); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.small { height: var(--ctl-h-sm); padding: 0 10px; font-size: var(--fs-sm); }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=url], input[type=email], select, textarea {
  font: inherit; font-size: var(--fs-md); color: var(--text); background: var(--input-bg);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 12px; min-width: 0;
  height: var(--ctl-h); transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; padding: 8px 12px; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:hover:not(:disabled):not(:focus), textarea:hover:not(:disabled):not(:focus) { border-color: color-mix(in srgb, var(--border-strong) 60%, var(--muted)); }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: var(--ring); border-color: var(--primary); }
input:disabled, textarea:disabled { opacity: .6; cursor: not-allowed; }
textarea.code { font-family: var(--mono); font-size: 13px; direction: ltr; text-align: left; width: 100%; min-height: 220px; resize: vertical; tab-size: 4; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
label.field > input, label.field > textarea, label.field > select { color: var(--text); font-size: 14px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.toolbar { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar input[type=search] { flex: 1 1 240px; max-width: 360px; }
.toolbar .count { margin-inline-start: auto; color: var(--muted); font-size: 13px; }

.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th, table.grid td { padding: 9px 12px; text-align: start; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
table.grid th { font-weight: 600; color: var(--muted); font-size: 12.5px; background: var(--surface-2); position: sticky; top: 0; user-select: none; }
table.grid th.sortable { cursor: pointer; }
table.grid th.sortable:hover { color: var(--text); }
table.grid th .arrow { font-size: 10px; margin-inline-start: 4px; }
table.grid tbody tr:hover { background: var(--hover); }
table.grid tbody tr.selected { background: var(--primary-soft); }
table.grid tr.clickable { cursor: pointer; }
table.grid td.check, table.grid th.check { width: 36px; padding-inline-end: 0; }
table.grid td.wrap { white-space: normal; }
table.grid tbody tr:last-child > td { border-bottom: 0; }
input[type=checkbox] { accent-color: var(--primary); width: 15px; height: 15px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--grey); vertical-align: middle; flex: none; }
.dot.on { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.5; background: var(--badge-bg); color: var(--muted); white-space: nowrap;
}
.badge svg.icon { width: 12px; height: 12px; stroke-width: 2.2; }
.badge.green { background: var(--success-soft); color: var(--success-text); }
.badge.red { background: var(--danger-soft); color: var(--danger-text); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.badge.amber { background: var(--warning-soft); color: var(--warning-text); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.outline { background: transparent; border: 1px solid var(--border-strong); color: var(--muted); padding: 1px 7px; }

/* details page */
dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.disk-bar { height: 6px; border-radius: 3px; background: var(--badge-bg); overflow: hidden; margin-top: 4px; }
.disk-bar > span { display: block; height: 100%; background: var(--primary); }
.disk-bar.full > span { background: var(--danger); }
.form-grid { display: grid; gap: 12px; }

pre.output {
  direction: ltr; text-align: left; unicode-bidi: plaintext;
  font-family: var(--mono); font-size: 12.5px; background: var(--code-bg); color: var(--code-text);
  margin: 0; padding: 12px 14px; border-radius: 8px; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}
.counts { display: flex; gap: 8px; flex-wrap: wrap; }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0; background: var(--scrim); z-index: 100;
  display: grid; place-items: center; padding: 16px; animation: fade .12s ease-out;
}
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-lg); }
.modal.wide { width: min(820px, 100%); }
.modal .card-body { display: grid; gap: 14px; }
.form-stack { display: grid; gap: 14px; }
label.field > .hint { font-size: 12px; color: var(--muted); }
.modal-foot { display: flex; gap: 8px; justify-content: flex-start; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.warn-box { background: var(--warning-soft); color: var(--warning-text); padding: 10px 14px; border-radius: 8px; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: scale(.97) } to { opacity: 1; transform: none } }

.toast-host { position: fixed; bottom: 20px; inset-inline-start: 20px; z-index: 200; display: grid; gap: 8px; }
.toast { background: var(--toast-bg); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow-lg); max-width: 420px; animation: fade .15s ease-out; }
.toast a { color: #5EEAD4; }
.toast.error { background: var(--danger); }
.toast.success { background: #15803d; }

.steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 14px; }

/* login (separate page, light only) */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(160deg, #0A1B2E 0%, #0E4652 100%); }
.login-card { width: min(380px, 100%); }
.login-card .card-body { padding: 28px; display: grid; gap: 16px; }
.login-card .brand { color: var(--text); font-size: 18px; justify-content: center; padding: 0; font-weight: 700; }
.login-card .brand-logo { width: 44px; height: 44px; border-radius: 11px; box-shadow: 0 4px 12px rgba(8, 37, 34, .25); }
.login-card .brand-name { color: var(--text); font-size: 20px; }
.error-text { color: var(--danger); min-height: 1.2em; font-size: 13px; }

/* ============================================================================================
   Classroom view
   ============================================================================================ */

.stat {
  --accent: var(--muted); --accent-soft: var(--badge-bg);
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 11px; min-width: 132px;
  padding: 10px 16px 10px 14px; border-radius: 12px; font: inherit; color: var(--text); text-align: start;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface) 62%);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.stat::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px; background: var(--accent); opacity: .85; }
.stat.clickable { cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; }
.stat.clickable:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.stat.clickable:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-soft); border-color: var(--primary); }
.stat.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
.stat.total { --accent: var(--primary); --accent-soft: var(--primary-soft); }
.stat.online { --accent: var(--success); --accent-soft: var(--success-soft); }
.stat.offline { --accent: var(--grey); --accent-soft: var(--badge-bg); }
.stat.uwf { --accent: var(--warning); --accent-soft: var(--warning-soft); }
.stat.users { --accent: var(--violet); --accent-soft: var(--violet-soft); }

/* action toolbar: primary buttons, dropdown groups, selection chip */
.actionbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 10px; margin-bottom: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
}
.abtn-group { display: flex; gap: 4px; align-items: center; }
.abtn-sep { width: 1px; align-self: stretch; background: var(--border); margin: 4px 4px; }
.abtn {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px;
  border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 550; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s, box-shadow .12s;
}
.abtn svg.icon { width: 18px; height: 18px; color: var(--primary); stroke-width: 1.8; flex: none; }
.abtn:hover:not(:disabled) { background: var(--hover); border-color: var(--border-strong); }
.abtn:active:not(:disabled) { background: var(--primary-soft); }
.abtn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-soft); border-color: var(--primary); }
.abtn:disabled { cursor: default; color: var(--muted); background: transparent; border-color: transparent; opacity: .6; }
.abtn:disabled svg.icon { color: var(--grey); opacity: .75; }
.abtn.accent:not(:disabled) { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 1px 2px color-mix(in srgb, var(--primary) 30%, transparent); }
.abtn.accent:not(:disabled) svg.icon { color: var(--on-primary); }
.abtn.accent:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.abtn.danger svg.icon, .abtn.lock-btn svg.icon { color: var(--danger); }
.abtn.unlock-btn svg.icon, .abtn.ok svg.icon { color: var(--success); }
.abtn.warn svg.icon { color: var(--warning); }
.abtn:disabled.lock-btn svg.icon, .abtn:disabled.unlock-btn svg.icon { color: var(--grey); }
/* lock / blank / unlock read as one segmented control */
.seg-lock { gap: 0; }
.seg-lock .abtn { border-radius: 0; margin-inline-start: -1px; }
.seg-lock .abtn:first-child { border-start-start-radius: 9px; border-end-start-radius: 9px; margin-inline-start: 0; }
.seg-lock .abtn:last-child { border-start-end-radius: 9px; border-end-end-radius: 9px; }
.seg-lock .abtn:hover:not(:disabled), .seg-lock .abtn:focus-visible { position: relative; z-index: 1; }
.seg-lock .abtn:disabled { border-color: var(--border); opacity: .8; }

/* dropdowns */
.dd { position: relative; }
.dd-chev { display: inline-flex; margin-inline-start: -2px; }
.dd-chev svg.icon { width: 14px !important; height: 14px !important; color: var(--muted) !important; transition: transform .15s; }
.dd.open .dd-trigger { background: var(--primary-soft); border-color: var(--primary-border); }
.dd.open .dd-chev svg.icon { transform: rotate(180deg); }
.dd-menu { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 40; min-width: 240px; }
.dd-menu.hidden { display: none; }
.menu-item.ok svg.icon { color: var(--success); }
.menu-item.warn svg.icon { color: var(--warning); }

/* selection chip */
.sel-pill {
  display: flex; align-items: center; gap: 6px; height: 36px; margin-inline-end: 4px;
  padding-block: 0; padding-inline: 12px 5px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-border);
  font-weight: 650; font-size: 13px; white-space: nowrap;
}
.sel-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.sel-pill .icon-btn { color: inherit; }
.sel-pill .icon-btn:hover { background: color-mix(in srgb, var(--primary) 14%, transparent); }
.sel-all {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px;
  border: 0; background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow);
}
.sel-all svg.icon { width: 14px; height: 14px; color: var(--primary); }
.sel-all:hover:not(:disabled) { background: var(--hover); }
.sel-all:disabled { opacity: .5; cursor: default; }
.sel-pill.empty-sel { background: var(--badge-bg); color: var(--muted); border-color: var(--border); font-weight: 500; }
.sel-pill.empty-sel .sel-dot { background: var(--grey); box-shadow: none; }

/* controls row */
.room-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.search-box { position: relative; flex: 0 1 320px; min-width: 200px; }
.search-box svg.icon { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.search-box input { width: 100%; padding-inline-start: 34px; }
.ctl-group { display: flex; align-items: center; gap: 10px; }
.room-controls .count { color: var(--muted); font-size: 13px; }
.room-controls .seg { margin-inline-start: auto; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: var(--ctl-h); padding: 0 14px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer;
}
.chip svg.icon { width: 16px; height: 16px; color: var(--muted); }
.chip:hover { background: var(--hover); }
.chip.active { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary); }
.chip.active svg.icon { color: var(--primary); }
.size-ctl { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); padding: 0 4px; }
.size-ctl svg.icon { width: 16px; height: 16px; }
.size-ctl input[type=range] { width: 90px; accent-color: var(--primary); cursor: pointer; }
.seg { display: inline-flex; align-items: center; min-height: var(--ctl-h); padding: 3px; border-radius: 10px; background: var(--badge-bg); border: 1px solid var(--border); }
.seg-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 7px; white-space: nowrap;
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer;
}
.seg-btn svg.icon { width: 16px; height: 16px; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }

/* tile grid (lab map) */
.tile-grid { --tile-min: 210px; display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile-min), 1fr)); gap: 16px; align-content: start; min-height: 120px; }
.tile-grid[data-size=s] { --tile-min: 150px; gap: 10px; }
.tile-grid[data-size=l] { --tile-min: 280px; gap: 18px; }

.pc-tile {
  position: relative; display: flex; flex-direction: column; cursor: pointer; user-select: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 8px 8px 10px;
  box-shadow: var(--shadow); transition: border-color .14s, box-shadow .14s, background-color .14s, transform .14s;
  outline: none;
}
.pc-tile:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.pc-tile:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.pc-tile.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary), 0 8px 22px color-mix(in srgb, var(--primary) 18%, transparent); background: var(--tile-selected-bg); }
.pc-tile.offline:not(.selected) { background: color-mix(in srgb, var(--surface) 70%, var(--bg)); }
.pc-tile.offline .tile-name { color: var(--muted); }

.tile-screen {
  position: relative; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden;
  background: var(--screen-off); color: #fff;
  border: 3px solid var(--screen-bezel); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 2px 6px rgba(15, 23, 42, .18);
}
.tile-screen > img, .tile-screen > canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-screen.user { background: var(--screen-user); }
.tile-screen.idle { background: var(--screen-idle); }
.tile-screen.user::after {
  /* faint "wallpaper" sheen */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 85% 0%, rgba(255,255,255,.18), transparent 60%);
}
.screen-ph {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 6px 10px; text-align: center; z-index: 1;
}
.screen-glyph { position: absolute; top: 6px; inset-inline-end: 8px; opacity: .45; }
.screen-glyph svg.icon { width: 14px; height: 14px; }
.screen-avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.35);
  font-weight: 700; font-size: 14px; margin-bottom: 2px;
}
.screen-user {
  font-size: 17px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.screen-sub { font-size: 11.5px; opacity: .75; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-main { font-size: 13px; font-weight: 600; opacity: .9; }
.screen-icon svg.icon { width: 24px; height: 24px; opacity: .7; }
.tile-screen.off .screen-main { color: #8a96ab; }
.tile-screen.off .screen-sub { color: #6b778c; opacity: 1; }
.tile-screen.off .screen-icon svg.icon { color: #5c687d; opacity: 1; }
.tile-screen.idle .screen-icon svg.icon { opacity: .55; }

.tile-check {
  position: absolute; top: 2px; inset-inline-start: 2px; z-index: 3;
  width: 24px; height: 24px; border-radius: 50%; padding: 0; cursor: pointer;
  display: grid; place-items: center; color: transparent;
  background: rgba(255,255,255,.9); border: 1.5px solid var(--border-strong);
  opacity: 0; transition: opacity .1s;
}
.tile-check svg.icon { width: 14px; height: 14px; stroke-width: 3; }
.pc-tile:hover .tile-check, .pc-tile:focus-visible .tile-check { opacity: 1; }
.pc-tile.selected .tile-check { opacity: 1; background: var(--primary); border-color: var(--surface); color: var(--on-primary); box-shadow: 0 1px 4px rgba(0,0,0,.25); }

.tile-meta { padding: 8px 3px 1px; display: grid; gap: 6px; min-width: 0; }
.tile-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.tile-title .dot { width: 9px; height: 9px; }
.tile-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tile-badges { display: flex; gap: 4px; flex-wrap: nowrap; min-height: 21px; overflow: hidden; }
.tile-badges .badge { font-size: 11.5px; padding: 1px 7px; flex: none; }
.tile-badges .badge.shrink { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: block; }
.badge.icon-only { padding: 1px 4px; }
.badge.icon-only svg.icon { width: 13px; height: 13px; }
.tile-extra { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; }
.tile-extra:empty { display: none; }
.pc-tile.offline .tile-name { color: var(--muted); }

.tile-grid[data-size=s] .pc-tile { padding: 6px; border-radius: 10px; }
.tile-grid[data-size=s] .screen-user { font-size: 14px; }
.tile-grid[data-size=s] .screen-avatar, .tile-grid[data-size=s] .screen-glyph, .tile-grid[data-size=s] .tile-extra { display: none; }
.tile-grid[data-size=s] .screen-main { font-size: 11.5px; }
.tile-grid[data-size=s] .screen-icon svg.icon { width: 18px; height: 18px; }
.tile-grid[data-size=s] .tile-name { font-size: 13px; }
.tile-grid[data-size=s] .tile-badges .badge.outline { display: none; }
.tile-grid[data-size=l] .screen-user { font-size: 22px; }
.tile-grid[data-size=l] .screen-avatar { width: 40px; height: 40px; font-size: 18px; }
.tile-grid[data-size=l] .tile-name { font-size: 15px; }

.tiles-host .empty, .table-card .empty { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.table-card .empty { border: 0; }
/* the table lives next to the sidebar: drop secondary columns by the card's own width, not the viewport's */
.table-card { container-type: inline-size; }
@container (max-width: 1250px) { .table-card .hide-narrow { display: none; } }

/* context menu */
.ctx-menu {
  position: fixed; z-index: 150; min-width: 230px; padding: 6px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 11px;
  box-shadow: var(--shadow-lg); animation: pop .1s ease-out;
}
.menu-head { display: flex; align-items: center; gap: 8px; padding: 7px 10px 8px; font-size: 13px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 7px;
  border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; text-align: start; cursor: pointer;
}
.menu-item svg.icon { width: 17px; height: 17px; color: var(--muted); }
.menu-item:hover:not(:disabled), .menu-item:focus-visible { background: var(--primary-soft); outline: none; }
.menu-item:hover:not(:disabled) svg.icon { color: var(--primary); }
.menu-item.danger, .menu-item.danger svg.icon { color: var(--danger); }
.menu-item:disabled { color: var(--grey); cursor: default; }
.menu-item:disabled svg.icon { color: var(--grey); opacity: .7; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 6px; }
/* the keys of a shortcut at the end of a menu row */
.menu-kbd { margin-inline-start: auto; padding-inline-start: 14px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ============================================================================================
   Responsive
   ============================================================================================ */
@media (max-width: 1400px) {
  .stat { min-width: 0; padding: 8px 12px; }
}
/* secondary table columns, hidden when the table would get too wide */
@media (max-width: 1100px) {
  .hide-narrow { display: none; }
}
@media (max-width: 1180px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: var(--sidebar-w);
    transform: translateX(105%); transition: transform .18s ease-out; box-shadow: var(--shadow-lg);
  }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 35; }
  .mobilebar {
    display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px;
    background: var(--sidebar-bg); color: var(--sidebar-text); position: sticky; top: 0; z-index: 30;
  }
  .mobilebar .icon-btn:hover { background: var(--sidebar-hover); }
  .actionbar { top: 52px; }
  .main { padding: 16px 18px 32px; }
}
@media (max-width: 760px) {
  .main { padding: 12px; }
  .tile .value { font-size: 22px; }
  .abtn { min-width: 64px; }
  .abtn-label { font-size: 11.5px; }
}

/* ============================================================================================
   Live screens: thumbnails in tiles, exam / locked placeholders, full viewer
   ============================================================================================ */
:root {
  --screen-exam: linear-gradient(140deg, #7a3e04 0%, #b45309 60%, #c2410c 100%);
  --screen-locked: linear-gradient(140deg, #1C2A36 0%, #33475A 100%);
  --viewer-bg: #08131D;
  --viewer-head: #0E1C29;
  --viewer-border: rgba(255, 255, 255, .08);
}
:root[data-theme=dark] {
  --screen-exam: linear-gradient(140deg, #4a2603 0%, #7c3a06 60%, #8a2e0a 100%);
  --screen-locked: linear-gradient(140deg, #0f1726 0%, #1d2738 100%);
  --viewer-bg: #050A08;
  --viewer-head: #0B1612;
}
.tile-screen > img.screen-img { object-fit: contain; background: #000; }
.tile-screen.live { background: #000; }
.tile-screen.live::after { display: none; }
.tile-screen.stale > img.screen-img { filter: grayscale(.7) brightness(.6); }
.tile-screen.stale::before {
  content: "התמונה לא מתעדכנת"; position: absolute; z-index: 2; top: 6px; inset-inline-end: 6px;
  font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fde68a;
}
.tile-screen.exam { background: var(--screen-exam); }
.tile-screen.locked { background: var(--screen-locked); }
.tile-screen.exam .screen-icon svg.icon, .tile-screen.locked .screen-icon svg.icon { opacity: .85; }
.tile-screen.exam .screen-main { font-size: 14px; font-weight: 700; opacity: 1; }
.tile-screen.displayoff, .tile-screen.nodisplay { background: var(--screen-locked); }
.tile-screen.displayoff .screen-icon svg.icon, .tile-screen.nodisplay .screen-icon svg.icon { opacity: .8; }
.screen-wake { margin-top: 4px; position: relative; z-index: 2; }
.tile-grid[data-size=s] .screen-wake { height: 22px; padding: 0 7px; font-size: 11px; }
.screen-chip {
  position: absolute; z-index: 2; bottom: 5px; inset-inline-start: 5px; max-width: calc(100% - 10px);
  padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.6;
  background: rgba(10, 16, 30, .72); color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  backdrop-filter: blur(2px);
}
.tile-grid[data-size=s] .screen-chip { font-size: 10.5px; padding: 0 6px; }
.badge.exam-badge { flex: none; }
.pc-tile .tile-screen.live { cursor: zoom-in; }

/* device page live thumbnail */
.tile-screen.device-shot { width: min(480px, 100%); flex: none; cursor: zoom-in; }

/* full viewer (NetSupport "View" / Veyon "Watch") */
body.viewer-open { overflow: hidden; }
/* The viewer takes the whole window, edge to edge, and follows it when it is resized or maximized: one slim toolbar
   on top and the remote picture in all the rest. */
.viewer-backdrop {
  position: fixed; inset: 0; z-index: 120; display: grid; place-items: stretch;
  background: var(--viewer-bg); animation: fade .12s ease-out;
}
.viewer {
  position: relative; touch-action: manipulation;
  width: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden;
  background: var(--viewer-bg); color: #e2e8f0; container: viewer / inline-size;
}
/* A narrower window keeps everything on one row: the tool labels go first (their icons and tooltips stay), then the
   stream chip, then the user line. Controlling needs more room (the special keys sit in the middle). */
@container viewer (max-width: 1560px) {
  .viewer.controlling .viewer-actions .viewer-btn > span, .viewer.multi .viewer-actions .viewer-btn > span { display: none; }
  .viewer.controlling .viewer-actions .viewer-btn, .viewer.multi .viewer-actions .viewer-btn { width: 32px; padding: 0; justify-content: center; }
}
@container viewer (max-width: 1240px) {
  .viewer-actions .viewer-btn > span { display: none; }
  .viewer-actions .viewer-btn { width: 32px; padding: 0; justify-content: center; }
  .viewer.controlling .viewer-meta, .viewer.multi .viewer-meta { display: none; }
}
@container viewer (max-width: 1000px) {
  .viewer-meta, .viewer-badge { display: none; }
  .viewer.controlling .viewer-sub { display: none; }
}
/* A computer's own window (js/windows.js): the window IS the viewer, so it fills it edge to edge instead of floating
   over the page as a card, and follows the window when it is resized. */
.own-window .viewer-backdrop { padding: 0; place-items: stretch; background: var(--viewer-bg); animation: none; }
.own-window .viewer { width: 100%; height: 100%; border: 0; border-radius: 0; box-shadow: none; animation: none; }
/* name and stream | mode, keys, displays (centred) | tools and window buttons */
.viewer-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px;
  min-height: 48px; padding: 6px 10px 6px 12px; box-sizing: border-box;
  background: var(--viewer-head); border-bottom: 1px solid var(--viewer-border); transition: box-shadow .15s;
}
.viewer-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.viewer-center { display: flex; align-items: center; gap: 8px; min-width: 0; }
.viewer-center .rc-modes { margin-inline-end: 0; }
.viewer-badge {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none;
  background: linear-gradient(140deg, #0E7C86, #163E63); color: #fff;
}
.viewer-badge svg.icon { width: 17px; height: 17px; }
.viewer-names { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.viewer-name { font-weight: 700; font-size: 14.5px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-sub { font-size: 12px; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the stream in one quiet chip: ● שידור חי | 20.0 fps · 1360×768 */
.viewer-meta {
  display: flex; align-items: center; gap: 8px; flex: none; margin-inline-start: 6px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--viewer-border);
}
.viewer-meta-sep { width: 1px; height: 12px; background: rgba(255, 255, 255, .14); }
.viewer-pill { font-size: 12px; font-variant-numeric: tabular-nums; color: #94a3b8; white-space: nowrap; }
.viewer-pill:empty { display: none; }

.viewer-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #fca5a5; white-space: nowrap; }
.viewer-live .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .25); animation: blink 1.4s ease-in-out infinite; }
.viewer-live.off { color: #64748b; }
.viewer-live.off .live-dot { background: #475569; box-shadow: none; animation: none; }
@keyframes blink { 50% { opacity: .35 } }
.viewer-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.viewer-sep { width: 1px; height: 20px; margin: 0 4px; background: var(--viewer-border); flex: none; }
.viewer-btn { flex: none; white-space: nowrap; }
.viewer.controlling .viewer-head { box-shadow: inset 0 -2px 0 #f59e0b; }
.viewer-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 8px;
  border: 1px solid var(--viewer-border); background: rgba(255, 255, 255, .04); color: #e2e8f0;
  font: inherit; font-size: 13px; cursor: pointer;
}
.viewer-btn svg.icon { width: 16px; height: 16px; }
.viewer-btn:hover { background: rgba(255, 255, 255, .1); }
.viewer-btn.icon { width: 32px; padding: 0; justify-content: center; }
.viewer-top { display: flex; flex-direction: column; flex: none; }
.viewer-main { position: relative; flex: 1; min-height: 0; display: flex; }
/* touch-action none: fingers on the remote picture are ours (gestures in rc-touch.js), never a page scroll or zoom */
.viewer-stage {
  position: relative; flex: 1; min-width: 0; min-height: 0; display: grid; place-items: center; background: #000;
  overflow: hidden; touch-action: none; overscroll-behavior: contain; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
.viewer-stage.zoomed .viewer-img { will-change: transform; }
.viewer-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; user-select: none; }
/* "fill the window": the picture over the whole area, each axis scaled on its own (remote.js pictureRect maps the mouse) */
.viewer-img.fill { object-fit: fill; }
.viewer-img:not([src]):not(canvas), .viewer-img.empty { visibility: hidden; }
.viewer-img.blur { filter: blur(6px) brightness(.6); }
.viewer-msg {
  position: absolute; display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: #cbd5e1; font-size: 15px; font-weight: 600; text-align: center; padding: 18px 26px; border-radius: 12px;
}
.viewer-msg.over-image { background: rgba(2, 6, 23, .72); }
.viewer-msg-icon svg.icon { width: 40px; height: 40px; opacity: .6; }
/* what the mode means, over the bottom of the picture for a few seconds */
.viewer-hint {
  position: absolute; z-index: 5; bottom: 18px; left: 50%; transform: translate(-50%, 8px); max-width: min(760px, calc(100% - 32px));
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; box-sizing: border-box;
  background: rgba(8, 15, 13, .86); border: 1px solid rgba(255, 255, 255, .1); color: #cbd5e1; font-size: 12.5px; line-height: 1.5;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
}
.viewer-hint.show { opacity: 1; transform: translate(-50%, 0); }
.viewer-hint svg.icon { width: 15px; height: 15px; flex: none; color: #5EEAD4; }
.viewer.controlling .viewer-hint svg.icon { color: #fbbf24; }

/* the browser's full screen: the toolbar floats over the picture and slides away; a tab at the top brings it back */
.viewer-reveal { display: none; }
.viewer.immersive .viewer-top {
  position: absolute; z-index: 9; top: 0; inset-inline: 0; transform: translateY(-100%); transition: transform .2s ease;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}
.viewer.immersive.bar-shown .viewer-top, .viewer.immersive .viewer-top:focus-within:has(:focus-visible) { transform: none; }
.viewer.immersive .viewer-reveal {
  display: grid; place-items: center; position: absolute; z-index: 8; top: 0; left: 50%; transform: translateX(-50%);
  width: 72px; height: 16px; padding: 0; border: 1px solid var(--viewer-border); border-top: 0; border-radius: 0 0 9px 9px;
  background: rgba(16, 30, 25, .82); color: #cbd5e1; cursor: pointer; opacity: .75; transition: opacity .15s, height .15s;
}
.viewer.immersive .viewer-reveal:hover { opacity: 1; height: 20px; }
.viewer.immersive .viewer-reveal svg.icon { width: 14px; height: 14px; }
.viewer.immersive.controlling .viewer-reveal { background: rgba(217, 119, 6, .85); border-color: #f59e0b; color: #fff; }

/* Full screen on a computer: the toolbar is a floating bar in the middle of the top edge (NetSupport / AnyDesk style)
   instead of a strip across the whole width, so it covers as little of the student's screen as possible. */
.viewer.immersive:not(.mobile) .viewer-top {
  top: 8px; left: 50%; right: auto; width: max-content; max-width: calc(100% - 32px);
  transform: translate(-50%, calc(-100% - 12px)); border-radius: 14px; overflow: visible;
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(14, 26, 22, .9); backdrop-filter: blur(10px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
}
.viewer.immersive:not(.mobile).bar-shown .viewer-top,
.viewer.immersive:not(.mobile) .viewer-top:focus-within:has(:focus-visible) { transform: translate(-50%, 0); }
.viewer.immersive:not(.mobile) .viewer-head { display: flex; border-radius: 14px; border-bottom: 0; background: transparent; gap: 18px; }
.viewer.immersive:not(.mobile).controlling .viewer-head { box-shadow: inset 0 -2px 0 #f59e0b; }

/* The toolbar sits above the picture, so its menus open over it. */
.viewer-top { position: relative; z-index: 7; }
.viewer-head { background: linear-gradient(180deg, #0E1E2C, var(--viewer-head)); }
.viewer-btn, .rc-seg { transition: background .12s, color .12s, border-color .12s; }
.viewer-btn:hover:not(:disabled) { border-color: rgba(255, 255, 255, .16); }

/* menus inside the (always dark) viewer */
.viewer .ctx-menu {
  background: #0F1D2A; color: #e2e8f0; border-color: rgba(255, 255, 255, .12); box-shadow: 0 18px 44px rgba(0, 0, 0, .6);
  min-width: 310px; max-height: calc(100vh - 80px); overflow: auto;
}
.viewer .menu-item { color: #e2e8f0; }
.viewer .menu-item svg.icon, .viewer .menu-kbd { color: #94a3b8; }
.viewer .menu-item:hover:not(:disabled), .viewer .menu-item:focus-visible { background: rgba(94, 234, 212, .12); }
.viewer .menu-item:hover .menu-kbd { color: #5EEAD4; }
.viewer .menu-group-title { color: #64748b; }
.viewer .menu-sep { background: rgba(255, 255, 255, .1); }
.viewer .dd.open .dd-trigger { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .2); }
.viewer .dd-chev svg.icon { color: #94a3b8 !important; }
.rc-shortcuts { gap: 6px; }
.rc-shortcuts .dd-chev { margin-inline-start: 0; }

/* whether the keys Windows keeps for itself (Win+R, Alt+Tab…) reach the PC: green when they do, an offer when not */
.rc-capture {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; flex: none;
  border: 1px dashed rgba(251, 191, 36, .55); background: rgba(251, 191, 36, .08); color: #fcd34d;
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.rc-capture svg.icon { width: 15px; height: 15px; }
.rc-capture:hover { background: rgba(251, 191, 36, .16); }
.rc-capture.on { border-style: solid; border-color: rgba(52, 211, 153, .45); background: rgba(16, 185, 129, .12); color: #6ee7b7; cursor: help; }
.rc-capture.on:hover { background: rgba(16, 185, 129, .18); }
.rc-capture:focus-visible { outline: 2px solid #5EEAD4; outline-offset: 1px; }
.viewer.mobile .rc-capture { display: none; }
@container viewer (max-width: 1400px) { .viewer.controlling .rc-capture span { display: none; } .viewer.controlling .rc-capture { padding: 0 7px; } }
@container viewer (max-width: 1180px) { .viewer.controlling .rc-shortcuts > span:not(.dd-chev) { display: none; } }

/* remote control (NetSupport "Control"): mode switch, key toolbar, clipboard, files dropped on the screen */
.viewer:focus { outline: none; }
.rc-modes { display: inline-flex; padding: 2px; border-radius: 9px; background: rgba(255, 255, 255, .06); border: 1px solid var(--viewer-border); margin-inline-end: 6px; }
.rc-seg {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border: 0; border-radius: 7px;
  background: transparent; color: #94a3b8; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.rc-seg svg.icon { width: 15px; height: 15px; }
.rc-seg:hover:not(:disabled) { color: #e2e8f0; }
.rc-seg.active { background: #0B7A75; color: #fff; }
.rc-seg:last-child.active { background: #d97706; }
.rc-seg:disabled { opacity: .45; cursor: default; }
.viewer-btn:disabled { opacity: .45; cursor: default; }
.rc-toolbar {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--viewer-head);
  border-bottom: 1px solid var(--viewer-border);
}
.rc-keys { display: flex; gap: 6px; flex-wrap: wrap; }
.rc-tool { height: 28px; font-size: 12.5px; font-weight: 600; }
.rc-spacer { flex: 1; }
/* keyboard of the controlled PC: its real input language (+ Caps Lock), a click switches the language there */
.rc-lang { gap: 6px; font-weight: 700; min-width: 44px; justify-content: center; }
.rc-lang:disabled { opacity: 1; cursor: default; }
.rc-lang-caps { font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 1px 5px; border-radius: 4px; background: #d97706; color: #fff; }
.rc-pop {
  position: absolute; top: 8px; inset-inline-end: 12px; z-index: 6; width: 360px; max-width: calc(100% - 24px);
  max-height: calc(100% - 16px); overflow: auto; display: flex; flex-direction: column; gap: 12px;
  padding: 12px; border-radius: 12px; background: var(--viewer-head); border: 1px solid var(--viewer-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
}
.rc-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rc-pop-heading { font-size: 14px; font-weight: 700; color: #fff; }
.rc-pop-part { display: flex; flex-direction: column; gap: 6px; }
.rc-pop-title { font-size: 12.5px; font-weight: 700; color: #cbd5e1; }
.rc-pop-hint { font-size: 12px; line-height: 1.5; color: #94a3b8; }
.rc-pop-text {
  width: 100%; resize: vertical; font: inherit; font-size: 13px; color: #e2e8f0; background: rgba(0, 0, 0, .35);
  border: 1px solid var(--viewer-border); border-radius: 8px; padding: 7px 9px; box-sizing: border-box;
}
.rc-pop-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.viewer-btn.primary { background: #0B7A75; border-color: #2DD4BF; color: #fff; font-weight: 600; }
.viewer-btn.primary:hover { background: #09625E; }
.viewer-btn:focus-visible, .rc-seg:focus-visible, .rc-key:focus-visible, .rc-bar-btn:focus-visible { outline: 2px solid #5EEAD4; outline-offset: 1px; }
.viewer-stage.controlling { cursor: default; }
.viewer-stage.controlling .viewer-msg { pointer-events: none; }
.rc-drop {
  position: absolute; inset: 14px; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  border: 2px dashed #3FD9C6; border-radius: 14px; background: rgba(11, 118, 110, .4); color: #fff; font-size: 16px; font-weight: 700;
  pointer-events: none;
}
.rc-drop svg.icon { width: 40px; height: 40px; }
.rc-files {
  position: absolute; bottom: 12px; inset-inline-start: 12px; z-index: 4; width: 320px; max-height: 45%; overflow: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.rc-file {
  display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border-radius: 10px; background: rgba(8, 37, 34, .94);
  border: 1px solid var(--viewer-border); font-size: 12.5px;
}
.rc-file-icon svg.icon { width: 18px; height: 18px; color: #3FD9C6; }
.rc-file-main { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; }
.rc-file-name { font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-file-size { color: #64748b; font-variant-numeric: tabular-nums; }
.rc-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.rc-bar-fill { display: block; height: 100%; width: 0; background: #2DD4BF; transition: width .15s; }
.rc-file-status { grid-column: 1 / -1; color: #94a3b8; }
.rc-file.saved .rc-bar-fill { background: #22c55e; }
.rc-file.saved .rc-file-status { color: #86efac; }
.rc-file.failed .rc-bar-fill { background: #ef4444; }
.rc-file.failed .rc-file-status { color: #fca5a5; }
.rc-file-x { border: 0; background: transparent; color: #64748b; cursor: pointer; padding: 0; }
.rc-file-x svg.icon { width: 14px; height: 14px; }

/* several displays: which one the picture shows */
.rc-monitors { margin-inline-end: 0; }
.rc-monitors .rc-seg.active, .rc-touchmodes .rc-seg.active { background: #0B7A75; }
.rc-touchbar { display: flex; align-items: center; gap: 6px; }
.rc-touchmodes { margin-inline-end: 0; }
.rc-zoom span { font-variant-numeric: tabular-nums; }

/* touch: the hidden field behind the phone keyboard (16px: iOS doesn't zoom the page on focus), the long-press ring */
.rc-kb {
  position: absolute; bottom: 0; inset-inline-start: 0; width: 1px; height: 1px; padding: 0; border: 0; margin: 0;
  opacity: 0; font-size: 16px; resize: none; background: transparent; color: transparent; caret-color: transparent;
  pointer-events: none; outline: none;
}
.rc-touch-ring {
  position: absolute; z-index: 3; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%;
  border: 3px solid #fbbf24; background: rgba(251, 191, 36, .18); pointer-events: none; animation: rc-ring .2s ease-out;
}
@keyframes rc-ring { from { transform: scale(.4); opacity: 0; } }

/* keys a phone keyboard doesn't have (shown on touch screens while controlling) */
.rc-keysbar { flex: none; background: var(--viewer-head); border-top: 1px solid var(--viewer-border); }
.rc-keystrip, .rc-keys-more { display: flex; gap: 6px; padding: 6px 8px; }
.rc-keystrip { overflow-x: auto; touch-action: pan-x; scrollbar-width: none; overscroll-behavior: contain; }
.rc-keystrip::-webkit-scrollbar { display: none; }
.rc-keys-more { flex-wrap: wrap; padding-bottom: 0; direction: ltr; }
.rc-key {
  flex: none; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--viewer-border);
  background: rgba(255, 255, 255, .07); color: #e2e8f0; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.rc-key:active { background: rgba(255, 255, 255, .2); }
.rc-key-arrow { font-size: 18px; padding: 0; }
.viewer-btn.on, .viewer-btn.on:hover, .rc-key.on, .rc-key.on:active { background: #d97706; border-color: #f59e0b; color: #fff; }

/* phone / tablet bottom bar */
.rc-bottom {
  flex: none; display: flex; gap: 4px; padding: 4px max(6px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  background: var(--viewer-head); border-top: 1px solid var(--viewer-border);
}
.rc-bar-btn {
  flex: 1 1 0; min-width: 44px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; border-radius: 10px; background: transparent; color: #cbd5e1; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.rc-bar-btn svg.icon { width: 22px; height: 22px; }
.rc-bar-btn:active:not(:disabled) { background: rgba(255, 255, 255, .1); }
.rc-bar-btn.on { color: #fbbf24; }
.rc-bar-btn:disabled { opacity: .4; cursor: default; }
.viewer:not(.mobile) .rc-bottom, .viewer:not(.mobile) .rc-keysbar, .viewer:not(.mobile) .rc-touchbar,
.viewer:not(.mobile) .rc-toolbar { display: none; }

/* phone / tablet layout (narrow window or touch screen; the class is set in viewer.js) */
.viewer-backdrop.mobile { padding: 0; place-items: stretch; }
.viewer.mobile { width: 100%; height: 100%; border: 0; border-radius: 0; animation: none; }
.viewer.mobile.controlling { box-shadow: inset 0 0 0 2px rgba(245, 158, 11, .7); }
.viewer.mobile .viewer-head {
  display: flex; min-height: 0;  gap: 8px; padding: calc(4px + env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 4px max(8px, env(safe-area-inset-left));
}
.viewer.mobile .viewer-badge, .viewer.mobile .viewer-meta, .viewer.mobile .rc-page,
.viewer.mobile .viewer-hint, .viewer.mobile .viewer-sep, .viewer.mobile .rc-fit, .viewer.mobile .rc-keys, .viewer.mobile .rc-spacer, .viewer.mobile .rc-desk,
.viewer.mobile .rc-toolbar.bare { display: none; }
.viewer.mobile .viewer-name { font-size: 14.5px; }
.viewer.mobile .viewer-title { flex: 1; }
.viewer.mobile .viewer-center { flex: none; }
.viewer.mobile .viewer-btn { height: 44px; min-width: 44px; font-size: 14px; }
.viewer.mobile .viewer-btn.icon { width: 44px; }
.viewer.mobile .viewer-btn svg.icon { width: 19px; height: 19px; }
.viewer.mobile .rc-modes { margin-inline-end: 0; }
.viewer.mobile .rc-seg { height: 40px; padding: 0 12px; font-size: 14px; }
.viewer.mobile .rc-toolbar { flex-wrap: wrap; justify-content: center; gap: 8px; padding: 6px 8px; }
.viewer.mobile .rc-touchbar { gap: 8px; }
.viewer.mobile .rc-pop {
  top: auto; bottom: 0; inset-inline: 0; width: auto; max-width: none; max-height: 100%; border-radius: 16px 16px 0 0;
  border-width: 1px 0 0; padding: 12px 12px 14px; box-shadow: 0 -12px 40px rgba(0, 0, 0, .6);
}
.viewer.mobile .rc-pop-text { font-size: 16px; }
.viewer.mobile .rc-files { width: auto; inset-inline-end: 12px; }
/* the phone keyboard is open: every pixel goes to the picture and the keys */
.viewer.mobile.kb-open .rc-toolbar { display: none; }
/* the copy / paste sheet needs the room too */
.viewer.mobile.pop-open .rc-toolbar, .viewer.mobile.pop-open .rc-keysbar { display: none; }
@media (max-width: 420px) {
  .viewer.mobile .viewer-sub { display: none; }
  .viewer.mobile .viewer-head .rc-seg { padding: 0 9px; }
}
/* phone held sideways: the bar becomes a side rail, the head and the toolbar share one row */
@media (orientation: landscape) and (max-height: 520px) {
  .viewer.mobile { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  .viewer.mobile .viewer-top { grid-column: 2; grid-row: 1; flex-direction: row; flex-wrap: wrap; align-items: center; background: var(--viewer-head); border-bottom: 1px solid var(--viewer-border); }
  .viewer.mobile .viewer-head { flex: 1 1 300px; border-bottom: 0; padding-block: 2px; }
  .viewer.mobile .rc-toolbar { flex: 0 1 auto; border-bottom: 0; padding-block: 2px; }
  .viewer.mobile .viewer-main { grid-column: 2; grid-row: 2; }
  .viewer.mobile .rc-keysbar { grid-column: 2; grid-row: 3; }
  .viewer.mobile .rc-keystrip { padding-block: 3px; }
  .viewer.mobile .rc-bottom {
    grid-column: 1; grid-row: 1 / -1; flex-direction: column; justify-content: center; border-top: 0; border-inline-end: 1px solid var(--viewer-border);
    padding: 4px 4px 4px max(4px, env(safe-area-inset-right));
  }
  .viewer.mobile .rc-bar-btn { flex: 0 0 auto; min-width: 56px; }
  .viewer.mobile.kb-open .viewer-top { display: none; }
  .viewer.mobile .viewer-sub { display: none; }
}

/* ---- classroom control ---- */
.room-select { min-width: 150px; font-weight: 600; }
.badge.dark { background: #0A1B2E; color: #DDF0F0; }
.badge.class-badge { gap: 4px; }
.badge.class-badge svg.icon { width: 13px; height: 13px; }
.pc-tile.class-locked .tile-screen { outline: 2px solid var(--danger); outline-offset: -2px; }
.fav-list { display: flex; flex-wrap: wrap; gap: 6px; }
.fav-chip { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--surface); }
.fav-chip button { border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.fav-pick { padding: 4px 10px; }
.fav-pick svg.icon { width: 14px; height: 14px; color: var(--warning); }
.fav-del { padding: 4px 6px; color: var(--muted) !important; }
.fav-del svg.icon { width: 12px; height: 12px; }
.fav-chip button:hover { background: var(--hover); }
.fav-save { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fav-save input { flex: 1 1 200px; }
.btn svg.icon { width: 15px; height: 15px; vertical-align: -3px; margin-inline-end: 4px; }
.exam-warn { display: flex; gap: 8px; align-items: flex-start; }
.exam-warn svg.icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
/* ---- restrictions drawer (NetSupport-style "הגבלות") ---- */
.drawer-backdrop { position: fixed; inset: 0; background: var(--scrim); z-index: 90; display: flex; justify-content: flex-end; animation: fade .15s ease-out; }
.drawer { width: min(520px, 100%); height: 100%; border-radius: 0; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); border-block: 0; border-inline-end: 0; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; }
.drawer-head h2 svg.icon { width: 20px; height: 20px; color: var(--primary); }
.drawer-body { flex: 1; overflow: auto; padding: 16px 20px; display: grid; gap: 16px; align-content: start; }
.drawer-foot { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.restrict-section { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.restrict-section h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14.5px; }
.restrict-section h3 svg.icon { width: 18px; height: 18px; color: var(--muted); }
.restrict-section .seg { justify-self: start; flex-wrap: wrap; }
.restrict-section .hint { font-size: 12px; color: var(--muted); }
.check-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check-row input { margin-top: 3px; accent-color: var(--primary); }
textarea.code.small { min-height: 72px; }
.restrict-targets { display: grid; gap: 8px; }
.restrict-count { font-size: 14px; }
.restrict-warn { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; background: var(--warning-soft); color: var(--warning); font-size: 13px; }
.restrict-warn svg.icon { width: 18px; height: 18px; flex: none; }
.restrict-list, .restrict-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 180px; overflow: auto; font-size: 13px; }
.restrict-list li, .restrict-feed li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.restrict-list .name, .restrict-feed .name { font-weight: 600; }
.restrict-presets { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.restrict-presets select { flex: 1; min-width: 160px; }
.restrict-badge { flex: none; }
.muted.small { font-size: 12.5px; }

/* device page: agent version / update state */

/* ============================================================================================
   Design system layer: styled select, unified cards / dialogs / toasts, and the responsive rules
   (kept last so it wins over the per-feature rules above at equal specificity)
   ============================================================================================ */

/* ---- styled select (js/dropdown.js): the native <select> stays in the DOM, hidden, as the value holder ---- */
.sel-dd { position: relative; display: inline-flex; min-width: 0; vertical-align: middle; }
.sel-dd > select {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; z-index: -1;
}
.sel-dd-btn {
  display: inline-flex; align-items: center; gap: 8px; width: 100%; min-width: 0; height: var(--ctl-h);
  padding-inline: 12px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--input-bg); color: var(--text); font: inherit; font-size: var(--fs-md); text-align: start;
  cursor: pointer; transition: border-color .12s, box-shadow .12s, background-color .12s;
}
.sel-dd-btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--border-strong) 60%, var(--muted)); background: color-mix(in srgb, var(--input-bg) 85%, var(--hover)); }
.sel-dd-btn:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--primary); }
.sel-dd.open .sel-dd-btn { border-color: var(--primary); box-shadow: var(--ring); }
.sel-dd-btn:disabled { opacity: .55; cursor: not-allowed; }
.sel-dd-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-dd-label.placeholder { color: var(--muted); }
.sel-dd-chev { display: inline-flex; color: var(--muted); flex: none; }
.sel-dd-chev svg.icon { width: 16px; height: 16px; transition: transform .15s var(--ease); }
.sel-dd.open .sel-dd-chev svg.icon { transform: rotate(180deg); color: var(--primary); }
label.field > .sel-dd { display: flex; }
.sel-dd.room-select .sel-dd-btn { font-weight: 600; }

.sel-dd-pop {
  position: fixed; z-index: 300; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); animation: dd-in .12s var(--ease); font-size: var(--fs-md);
}
.sel-dd-pop.up { animation-name: dd-in-up; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px) } to { opacity: 1; transform: none } }
@keyframes dd-in-up { from { opacity: 0; transform: translateY(4px) } to { opacity: 1; transform: none } }
.sel-dd-search-row { position: relative; padding: 6px 6px 4px; border-bottom: 1px solid var(--border); }
.sel-dd-search-row[hidden] { display: none; }
.sel-dd-search-row svg.icon { position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-40%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.sel-dd-search-row input.sel-dd-search { width: 100%; height: var(--ctl-h-sm); padding-inline-start: 32px; font-size: var(--fs-sm); }
.sel-dd-list { overflow-y: auto; padding: 5px; overscroll-behavior: contain; scrollbar-width: thin; }
.sel-dd-list:focus { outline: none; }
.sel-dd-opt {
  display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 10px 6px 12px; border-radius: 7px;
  cursor: pointer; user-select: none; white-space: nowrap;
}
.sel-dd-opt.active { background: var(--hover); }
.sel-dd-opt.selected { color: var(--primary); font-weight: 600; }
.sel-dd-opt.selected.active, .sel-dd-opt.selected { background: var(--primary-soft); }
.sel-dd-opt.disabled { color: var(--grey); cursor: default; }
.sel-dd-check { width: 16px; flex: none; display: inline-flex; color: var(--primary); }
.sel-dd-check svg.icon { width: 16px; height: 16px; stroke-width: 2.4; }
.sel-dd-text { overflow: hidden; text-overflow: ellipsis; }
.sel-dd-group { padding: 8px 12px 4px; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); letter-spacing: .03em; }
.sel-dd-empty { padding: 14px; text-align: center; color: var(--muted); font-size: var(--fs-sm); }

/* ---- page frame: one heading size, one card look ---- */
.card { border-radius: var(--radius-lg); }
.card-head { padding: var(--space-3) var(--space-5); min-height: 54px; flex-wrap: wrap; row-gap: var(--space-2); }
.card-head h2 { font-size: var(--fs-lg); }
.card-body { padding: var(--space-4) var(--space-5); }
.card + .card, .tiles + .card { margin-top: var(--space-4); }
.card .table-wrap:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.table-wrap { overflow-x: auto; max-width: 100%; scrollbar-width: thin; }
table.grid th, table.grid td { padding: 10px 14px; }
table.grid th { height: 40px; font-size: var(--fs-xs); letter-spacing: .02em; }
.toolbar { padding: var(--space-3) var(--space-4); gap: var(--space-2) var(--space-3); }
.toolbar .sel-dd { min-width: 160px; }
.empty { padding: var(--space-8) var(--space-6); }
.actions { gap: var(--space-2); align-items: center; }
.form-grid { gap: var(--space-3); }
label.field { font-weight: 500; }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.menu-group-title { padding: 8px 10px 3px; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); letter-spacing: .03em; }

/* ---- dialogs ---- */
.modal-backdrop { backdrop-filter: blur(2px); }
.modal { border-radius: var(--radius-lg); animation: pop .14s var(--ease); display: flex; flex-direction: column; }
.modal > .card-head { position: sticky; top: 0; z-index: 1; background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.modal > .card-body { flex: 1; }
.modal-foot { position: sticky; bottom: 0; flex-wrap: wrap; padding: var(--space-3) var(--space-5); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.modal .seg { flex-wrap: wrap; }
.drawer { border-radius: 0; }
.drawer-foot { flex-wrap: wrap; }

/* ---- toasts ---- */
.toast { display: flex; align-items: center; gap: var(--space-2); padding: 11px 16px; border-radius: var(--radius); font-size: var(--fs-md); line-height: 1.4; max-width: min(440px, calc(100vw - 32px)); animation: dd-in-up .16s var(--ease); }
.toast-text { flex: 1; min-width: 0; }
.toast-action { flex: none; margin-inline-start: var(--space-2); padding: 4px 10px; border: 1px solid rgba(255, 255, 255, .55); border-radius: var(--radius-sm); background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.toast-action:hover { background: rgba(255, 255, 255, .14); }
.toast-action:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---- login ---- */
.login-page { background: radial-gradient(1200px 600px at 80% -10%, #0E7C86 0%, transparent 60%), linear-gradient(160deg, #0A1B2E 0%, #0E4652 100%); }
.login-card { width: min(400px, 100%); border: 0; box-shadow: 0 24px 60px rgba(2, 6, 23, .45); }
.login-card .card-body { padding: 32px 30px; gap: var(--space-4); }
.login-card .brand { gap: 12px; margin-bottom: 4px; }
.login-card label.field input { height: 40px; }
.login-card .btn.primary { height: 40px; width: 100%; font-size: 15px; }

/* ---- classroom view ---- */
.stat { border-radius: var(--radius-lg); }
.actionbar { gap: var(--space-2); padding: 7px var(--space-2); border-radius: var(--radius-lg); row-gap: 6px; }
.abtn { min-width: 0; border-radius: var(--radius-sm); }
.abtn-group { gap: 6px; }
.seg-lock { gap: 0; }
.dd-menu { min-width: 250px; max-height: min(70vh, 520px); overflow-y: auto; }
.dd-more .dd-menu { inset-inline-start: auto; inset-inline-end: 0; }
/* folding toolbar (devices.js fitToolbar): fold-1 = lock group icon-only, fold-2 = secondary buttons icon-only,
   fold-3 = everything icon-only */
.actionbar.fold-1 .seg-lock .abtn-label,
.actionbar.fold-2 .abtn:not(.accent):not(.dd-trigger) .abtn-label,
.actionbar.fold-3 .abtn .abtn-label,
.actionbar.fold-3 .sel-all .abtn-label { display: none; }
.actionbar.fold-1 .seg-lock .abtn,
.actionbar.fold-2 .abtn:not(.accent):not(.dd-trigger),
.actionbar.fold-3 .abtn:not(.dd-trigger) { width: var(--ctl-h); padding: 0; justify-content: center; }
.actionbar.fold-3 .abtn { width: 34px; padding: 0; justify-content: center; }
.actionbar.fold-3 .dd-trigger .dd-chev { display: none; }
.actionbar.fold-3, .actionbar.fold-3 .abtn-group { gap: 4px; }
.actionbar.fold-3 .abtn-sep { display: none; }
.actionbar.fold-3 .sel-all { padding: 0 7px; }
.actionbar.fold-3 .sel-pill { padding-inline-start: 10px; }
.room-controls { gap: var(--space-2) var(--space-3); }
.room-controls .sel-dd { flex: 0 1 auto; }
.room-controls .room-select { min-width: 170px; max-width: 260px; }
.room-controls > .sel-dd:not(.room-select) { min-width: 140px; }
.room-controls .search-box { flex: 1 1 200px; max-width: 360px; min-width: 160px; }
.search-box input { height: var(--ctl-h); }
.ctl-group { gap: var(--space-2); }
.size-ctl { height: var(--ctl-h); }

/* ---- responsive ---- */
@media (max-width: 1400px) {
  .stat { min-width: 0; }
}
@media (max-width: 900px) and (min-width: 561px) {
  .stat { padding: 8px 12px; }
}
@media (max-width: 1180px) {
  .mobilebar { box-shadow: 0 1px 0 var(--sidebar-border), 0 4px 14px rgba(2, 6, 23, .18); }
  .mobilebar .brand-name { font-size: 15px; }
  .room-controls .size-ctl { display: none; }
}
@media (max-width: 760px) {
  .main { padding: var(--space-3); }
  .abtn { min-width: 0; }
  .abtn-label { font-size: inherit; }
  .card-head { padding: var(--space-3) var(--space-4); }
  .card-body { padding: var(--space-3) var(--space-4); }
  .room-controls .search-box { order: -1; flex: 1 1 100%; min-width: 0; }
  .room-controls .room-select, .room-controls > .sel-dd:not(.room-select) { flex: 1 1 calc(50% - 6px); min-width: 0; max-width: none; }
  .room-controls .count { margin-inline-start: auto; }
  .room-controls .seg { margin-inline-start: 0; }
  .toolbar input[type=search] { flex: 1 1 100%; max-width: none; }
  .toolbar .sel-dd { flex: 1 1 140px; }
  .toolbar .count { margin-inline-start: 0; }
  .modal-backdrop { padding: var(--space-2); align-items: end; }
  .modal { max-height: calc(100vh - 16px); width: 100%; }
  .modal-foot .btn { flex: 1 1 auto; }
  .drawer { width: 100%; }
  .drawer-head, .drawer-body, .drawer-foot { padding-inline: var(--space-4); }
  dl.kv { grid-template-columns: minmax(90px, max-content) minmax(0, 1fr); gap: 6px 12px; }
  .toast-host { inset-inline: 12px; bottom: 12px; }
  .toast { max-width: none; }
}
@media (max-width: 560px) {
  .sel-pill { flex: 1 1 100%; margin-inline-end: 0; }
  .sel-pill .sel-count { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .tile-grid { --tile-min: 140px; gap: 10px; }
  .tile-grid[data-size=s] { --tile-min: 110px; }
  .tile-grid[data-size=l] { --tile-min: 220px; }
  .tile-grid .tile-badges .badge.outline { display: none; }
  .room-controls .size-ctl { display: none; }
}
input[type=file] { font: inherit; font-size: var(--fs-sm); color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button {
  height: var(--ctl-h-sm); margin-inline-end: 10px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--hover); }

/* ---- metric tiles (UWF, licensing, updates): same family as the .stat strip ---- */
.tiles { gap: var(--space-3, 12px); }
.tiles > .card + .card { margin-top: 0; }
.tile { position: relative; overflow: hidden; padding: 14px 18px; --accent: var(--primary); display: flex; flex-direction: column; justify-content: center; min-height: 76px; }
.tile::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px; background: var(--accent); opacity: .85; }
.tile .label { font-size: 12px; line-height: 1.35; }
.tile .value { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tile.green { --accent: var(--success); } .tile.green .value { color: var(--success); }
.tile.red { --accent: var(--danger); } .tile.red .value { color: var(--danger); }
.tile.amber { --accent: var(--warning); } .tile.amber .value { color: var(--warning); }
.tile[style*="cursor"] { transition: transform .12s, box-shadow .12s; }
.tile[style*="cursor"]:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }

/* ---- form building blocks (forms.js): radio cards, check rows, button rows ------------------------------ */
/* Radios and checkboxes sit at the start of the line (the right edge in RTL); the text wraps under itself. */
input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; margin: 0; flex: none; }
input[type=checkbox] { margin: 0; flex: none; }
.choices { display: grid; gap: 8px; }
.choices-label { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.choice, .check-row {
  display: flex; align-items: flex-start; gap: 10px; text-align: start; cursor: pointer; color: var(--text);
}
.choice {
  padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  transition: border-color .12s, background-color .12s, box-shadow .12s;
}
.choice:hover { border-color: var(--border-strong); }
.choice.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary) inset; }
.choice.danger.selected { border-color: var(--danger, #dc2626); box-shadow: 0 0 0 1px var(--danger, #dc2626) inset; background: color-mix(in srgb, var(--danger, #dc2626) 8%, var(--surface)); }
.choice > input, .check-row > input { margin-top: 2px; }
.choices.compact { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.choices.compact .choices-label { grid-column: 1 / -1; }
.choices.compact .choice { padding: 9px 12px; }
.choice-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choice-title { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.choice-desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.choice-badge { font-size: 11px; }
.check-row { padding: 4px 0; font-size: 14px; }
.checks { display: grid; gap: 6px; }
.reboot-choice { display: grid; gap: 8px; }
.sub-panel { display: grid; gap: 12px; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: 10px; background: var(--surface-2); }
.modal .card-body { display: grid; gap: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.btn-row.nowrap { flex-wrap: nowrap; margin-top: 0; }
.kv-line { padding: 3px 0; line-height: 1.5; }
.ok-box { background: var(--success-soft); color: var(--success-text, var(--text)); padding: 10px 14px; border-radius: 8px; }
.modal .modal-foot a.btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.modal .card-body > * { min-width: 0; }

/* license vault (0.8.2) */
.drop-zone { display: grid; justify-items: center; gap: 6px; padding: 22px 16px; border: 2px dashed var(--border-strong);
  border-radius: 12px; text-align: center; cursor: pointer; color: var(--text); background: var(--surface-2, transparent); }
.drop-zone svg.icon { width: 26px; height: 26px; color: var(--primary); }
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.over { border-color: var(--primary); background: var(--primary-soft); outline: none; }
.drop-zone.big { margin: 4px 0; padding: 36px 16px; }
.nowrap { white-space: nowrap; }

/* license vault table (0.8.3): one aligned row per key */
.btn.danger-text { color: var(--danger); }
.btn.danger-text:hover { background: var(--danger-soft); }

/* licensing page (0.8.6): summary strip, tabs, one-row toolbars */

/* ============================================================================================
   Redesign 2026-11: computer page, rooms page, shared page furniture
   ============================================================================================ */
/* breadcrumb */
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: var(--space-3); font-size: var(--fs-sm); color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--link); }
.crumbs svg.icon { width: 13px; height: 13px; transform: rotate(90deg); opacity: .7; flex: none; }
.crumbs .crumb-here { color: var(--text); font-weight: 600; }
.card-head h2 { display: inline-flex; align-items: center; gap: var(--space-2); }
.card-head h2 svg.icon { width: 17px; height: 17px; color: var(--primary); flex: none; }
.btn svg.icon { width: 16px; height: 16px; flex: none; }
.btn.dd-trigger .dd-chev svg.icon { width: 14px; height: 14px; }
.dd > .dd-menu { position: absolute; z-index: 40; }
.dd-menu.dd-end { inset-inline-start: auto; inset-inline-end: 0; }

/* computer page: name, state, facts, live picture, actions */
.tile-screen.device-shot { width: 100%; padding: 0; font: inherit; cursor: zoom-in; display: block; border-radius: var(--radius); }
.tile-screen.device-shot:disabled { cursor: default; }
.tile-screen.device-shot:focus-visible { outline: none; box-shadow: var(--ring); }
.shot-open {
  position: absolute; z-index: 3; bottom: 8px; inset-inline-end: 8px; display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; color: #fff; background: rgba(4, 21, 19, .72);
  opacity: 0; transition: opacity .12s;
}
.shot-open svg.icon { width: 13px; height: 13px; }
.device-shot:not(:disabled):hover .shot-open, .device-shot:not(:disabled):focus-visible .shot-open { opacity: 1; }
@media (hover: none) { .device-shot.live .shot-open { opacity: 1; } }
.dev-shot-info { font-size: var(--fs-xs); color: var(--muted); text-align: center; min-height: 1.4em; }
.dev-hero-title { display: flex; align-items: center; gap: var(--space-2) var(--space-3); flex-wrap: wrap; }
.dev-hero-title h1 { font-size: 26px; line-height: 1.2; margin: 0; letter-spacing: -.01em; overflow-wrap: anywhere; }
.dev-state {
  display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 12px; border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 600; background: var(--badge-bg); color: var(--muted);
}
.dev-state.on { background: var(--success-soft); color: var(--success-text); }
.dev-state .dot { width: 8px; height: 8px; }
.dev-state .dot.on { box-shadow: none; }
.dev-badges { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.dev-badges:empty { display: none; }
.dev-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3) var(--space-5); }
.dev-fact { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dev-fact > svg.icon { width: 18px; height: 18px; color: var(--muted); flex: none; }
.dev-fact-text { display: grid; min-width: 0; line-height: 1.3; }
.dev-fact-label { font-size: var(--fs-xs); color: var(--muted); }
.dev-fact-value { font-weight: 600; overflow-wrap: anywhere; }
.dev-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; padding-top: var(--space-4); border-top: 1px solid var(--border); }
.dev-actions .btn svg.icon { color: var(--primary); }
.dev-actions .btn.primary svg.icon { color: inherit; }
.dev-actions .btn:disabled svg.icon { color: var(--grey); }


.kv-sub { font-size: var(--fs-xs); padding-inline-start: var(--space-3); }
.dev-card .card-body { display: grid; gap: var(--space-3); }
.dev-card .card-body > .btn-row { margin-top: 0; padding-top: var(--space-3); border-top: 1px solid var(--border); }
.dev-card .kv-line { display: grid; grid-template-columns: minmax(96px, max-content) minmax(0, 1fr); gap: 2px var(--space-3); align-items: baseline; padding: 4px 0; }
.dev-card .kv-line > .badge { justify-self: start; }
.dev-card details { padding: 4px 0; }
.dev-card details > summary { cursor: pointer; color: var(--muted); }
.dev-card details[open] > summary { color: var(--text); margin-bottom: 4px; }
.dev-card.no-first-line .card-body > div:first-child > .kv-line:first-child { display: none; }
.dev-card .warn-box { font-size: var(--fs-sm); }
.dev-sub { margin-top: var(--space-2); }
.dev-sub h3 { margin: 0 0 6px; font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.dev-adapter { padding: 8px 0; border-top: 1px solid var(--border); }
.dev-adapter-name { font-weight: 600; margin-bottom: 4px; }
.dev-adapter .ltr, dl.kv dd div.ltr { text-align: right; }
.dev-disk + .dev-disk { margin-top: var(--space-3); }
.dev-disk-row { display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.dev-disk-row > span:first-child { display: inline-flex; align-items: center; gap: var(--space-2); }
.dev-disk-label { color: var(--muted); }
.dev-hw-list { list-style: none; margin: 0; padding: 0; }
.dev-hw { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); padding: var(--space-1) 0; }
.dev-hw + .dev-hw { border-top: 1px solid var(--border); }
.dev-hw-name { flex: 1 1 14rem; min-width: 0; overflow-wrap: anywhere; }
.dev-hw-id { flex-basis: 100%; font-size: 0.8em; overflow-wrap: anywhere; }
.dev-hw-when { margin-top: var(--space-3); }
.dev-off-list { list-style: none; margin: 0; padding: 0; }
.dev-off { padding: var(--space-2) 0 var(--space-2) 0; padding-inline-start: var(--space-3); border-inline-start: 3px solid var(--border); }
.dev-off + .dev-off { margin-top: var(--space-2); }
.dev-off.ok { border-inline-start-color: var(--success-soft); }
.dev-off.warn { border-inline-start-color: var(--warning-text); }
.dev-off.bad { border-inline-start-color: var(--danger-text); }
.dev-off-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.dev-off-title { min-width: 0; overflow-wrap: anywhere; }
.dev-off-when { font-size: 0.85em; margin-top: 2px; }
.dev-off-detail { margin-top: var(--space-1); overflow-wrap: anywhere; }
.dev-off-warn { margin-bottom: var(--space-3); }
.dev-off-note { margin-bottom: var(--space-3); }
dl.kv dt { font-size: var(--fs-sm); }

@media (max-width: 560px) {
  .dev-hero-title h1 { font-size: 22px; }
  .dev-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
  .dev-actions > .btn.primary { flex: 1 1 100%; }
  .dev-actions > .btn, .dev-actions > .dd { flex: 1 1 calc(50% - 4px); }
  .dev-actions > .dd > .btn { width: 100%; }
}

/* computer page: the screen, the actions, and two lists of rows that open in place */
.dev-list { padding: 0; overflow: hidden; }
.dev-row + .dev-row { border-top: 1px solid var(--border); }
.dev-row > summary { list-style: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-3); padding: 11px var(--space-4); cursor: pointer; }
.dev-row > summary::-webkit-details-marker { display: none; }
.dev-row > summary:hover { background: var(--hover); }
.dev-row > summary:focus-visible { outline: none; box-shadow: inset var(--ring); }
.dev-row-icon { width: 34px; height: 34px; border-radius: var(--radius); display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.dev-row-icon svg.icon { width: 17px; height: 17px; }
.dev-row-text { display: grid; min-width: 0; line-height: 1.35; }
.dev-row-label { font-weight: 600; }
.dev-row-hint { font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; }
.dev-row-hint:empty { display: none; }
.dev-row-value { font-weight: 600; font-size: var(--fs-md); text-align: end; overflow-wrap: anywhere; max-width: 100%; }
.dev-row-value::before { content: ""; display: none; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 7px; vertical-align: 1px; }
.ok > summary .dev-row-value::before { display: inline-block; background: var(--success); }
.warn > summary .dev-row-value::before { display: inline-block; background: var(--warning); }
.bad > summary .dev-row-value::before { display: inline-block; background: var(--danger); }
.bad > summary .dev-row-value { color: var(--danger-text); }
.dev-row-chev { color: var(--muted); display: grid; transition: transform .15s var(--ease); }
.dev-row-chev svg.icon { width: 16px; height: 16px; }
.dev-row[open] > summary .dev-row-chev { transform: rotate(180deg); }
.dev-row[open] > summary { background: var(--surface-2); }
.dev-row-body > .card-body { padding: var(--space-4); }
.dev-row .dev-row-body { border-top: 1px solid var(--border); }
.dev-assign textarea { resize: vertical; }
.dev-history { overflow: hidden; }


.dev-card .kv-line { justify-items: start; }


@media (max-width: 760px) {
  .dev-row > summary { grid-template-columns: auto minmax(0, 1fr) auto; }
  .dev-row > summary .dev-row-value { grid-column: 2; grid-row: 2; text-align: start; font-weight: 500; font-size: var(--fs-sm); }
  .dev-row > summary .dev-row-chev { grid-column: 3; grid-row: 1 / span 2; }
  .dev-row > summary .dev-row-icon { grid-row: 1 / span 2; }
}

/* computer page: a brand hero, four glance tiles, one calm list at a time */
.dev2 { display: grid; gap: var(--space-5); max-width: 1180px; margin-inline: auto; width: 100%; }
.dev2 .crumbs { margin-bottom: calc(var(--space-2) * -1); }
.dev2-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.dev2-tile { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--space-3); align-items: center; text-align: start; font: inherit; color: var(--text); cursor: pointer;
  padding: 18px 20px; border: 1px solid var(--card-edge); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); transition: transform .12s var(--ease), box-shadow .12s; }
.dev2-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.dev2-tile:focus-visible { outline: none; box-shadow: var(--ring); }
.dev2-tile-icon { grid-row: 1 / span 3; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--badge-bg); color: var(--muted); }
.dev2-tile-icon svg.icon { width: 22px; height: 22px; }
.dev2-tile.ok .dev2-tile-icon { background: var(--success-soft); color: var(--success-text); }
.dev2-tile.warn .dev2-tile-icon { background: var(--warning-soft); color: var(--warning-text); }
.dev2-tile.bad .dev2-tile-icon { background: var(--danger-soft); color: var(--danger-text); }
.dev2-tile-label { font-size: var(--fs-sm); color: var(--muted); }
.dev2-tile-value { font-size: 19px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.dev2-tile.bad .dev2-tile-value { color: var(--danger-text); }
.dev2-tile-hint { font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; }
.dev2-tile-hint:empty { display: none; }
.dev2-tabs { justify-self: start; max-width: 100%; }
.dev2-tabs .seg-btn { height: 38px; padding: 0 22px; border-radius: 11px; font-size: var(--fs-md); font-weight: 600; }
.dev2 .dev-list, .dev2 .dev-history { border-radius: 18px; box-shadow: var(--shadow); margin-top: calc(var(--space-2) * -1); }
.dev2 .dev-row > summary { padding: 16px 22px; gap: var(--space-4); }
.dev2 .dev-row-icon { width: 40px; height: 40px; border-radius: 12px; }
.dev2 .dev-row-label { font-size: var(--fs-lg); }
.dev2 .dev-row-body > .card-body { padding: 20px 22px 22px; max-width: 760px; }
@media (max-width: 1000px) {
  .dev2-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .dev2-tile { padding: 14px; border-radius: 16px; }
  .dev2-tile-icon { width: 38px; height: 38px; border-radius: 12px; }
  .dev2-tile-value { font-size: var(--fs-lg); }
  /* Seven tabs do not fit a phone side by side: the row scrolls sideways instead of squeezing the names over each other. */
  .dev2-tabs { display: flex; justify-self: stretch; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  .dev2-tabs::-webkit-scrollbar { display: none; }
  .dev2-tabs .seg-btn { flex: 1 0 auto; padding: 0 14px; justify-content: center; }
  .dev2 .dev-row > summary { padding: 14px 16px; }
}

/* rooms page */
.room-card-icon { width: 36px; height: 36px; border-radius: var(--radius); display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.room-card-icon svg.icon { width: 18px; height: 18px; }

/* rooms page: one section per room with its live screens */

/* ---- one summary strip everywhere (classroom figures, disk protection, power, updates) ---- */
.tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.tiles { margin-bottom: var(--space-4); }
.stat, .tiles > .card.tile {
  border: 0; border-radius: 0; box-shadow: none; background: transparent; min-width: 0;
  border-inline-start: 1px solid var(--border); margin: 0;
}
.stat:first-child, .tiles > .card.tile:first-child { border-inline-start: 0; }
.stat::before, .tile::before { display: none; }
.stat { padding: 10px var(--space-4); }
.stat.clickable:hover { transform: none; box-shadow: none; background: var(--hover); }
.stat.clickable:focus-visible { box-shadow: inset var(--ring); }
.stat.active { background: var(--primary-soft); box-shadow: inset 0 -3px 0 var(--primary); }
.tiles > .card.tile { padding: var(--space-3) var(--space-5); min-height: 72px; }
.tiles > .card.tile[style*="cursor"]:hover { transform: none; box-shadow: none; background: var(--hover); }
.tile .label { font-size: var(--fs-sm); }
.tile .value { font-weight: 650; }
@media (max-width: 760px) {
  .tiles { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
  .stat { padding: 8px 10px; gap: 8px; }
  .tiles > .card.tile { padding: 10px var(--space-3); min-height: 60px; border-bottom: 1px solid var(--border); margin-bottom: -1px; }
}
@media (max-width: 560px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles > .card.tile:nth-child(odd) { border-inline-start: 0; }
  .stat { flex-direction: column; align-items: center; text-align: center; padding: 8px 3px; }
}

/* ---- shared fixes from the screen-by-screen review ---- */
/* table toolbars: title at the start, filters grouped at the end */
/* a table under a card head keeps square corners; the row buttons end on the card's inner edge */
.card-head ~ .table-wrap, .card-head ~ * .table-wrap { border-radius: 0; }
table.grid th:first-child, table.grid td:first-child { padding-inline-start: var(--space-5); }
table.grid th:last-child, table.grid td:last-child { padding-inline-end: var(--space-5); }
table.grid td:last-child > .btn-row.nowrap { justify-content: flex-end; }
/* left-to-right values stay under their right-aligned Hebrew headers */
table.grid td.ltr { text-align: right; }
table.grid td.wrap { min-width: 200px; }
/* messages */
.error-text { color: var(--danger-text); }
.error-text:empty { display: none; }
.modal-close { margin-inline-end: -6px; }
.modal-close svg.icon { width: 16px; height: 16px; }
/* toasts sit in the workspace, not on the sidebar's user row */
@media (min-width: 1181px) { .toast-host { inset-inline-start: calc(var(--sidebar-w) + 20px); } }
@media (max-width: 760px) {
  .modal-foot { padding-inline: var(--space-4); }
}

/* ---- batch 2: phone tables, updates and add-computers pages ---- */
/* data tables on a phone: one block per row, each value with its column name (dom.js stackTable) */
@media (max-width: 760px) {
  table.grid.stack, table.grid.stack tbody { display: block; }
  table.grid.stack thead { display: none; }
  table.grid.stack tbody tr { display: grid; gap: 6px; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
  table.grid.stack tbody tr:last-child { border-bottom: 0; }
  table.grid.stack tbody td {
    display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3);
    padding: 0; border: 0; white-space: normal; min-width: 0; text-align: start; overflow-wrap: anywhere;
  }
  table.grid.stack tbody td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: var(--fs-xs); font-weight: 500; }
  table.grid.stack tbody td[data-label=""]::before, table.grid.stack tbody td:first-child::before { display: none; }
  table.grid.stack tbody td:first-child { font-weight: 600; font-size: var(--fs-lg); justify-content: flex-start; align-items: center; gap: var(--space-2); }
  table.grid.stack tbody td:last-child[data-label=""] { justify-content: flex-start; padding-top: 4px; }
  table.grid.stack tbody td:last-child[data-label=""]:empty { display: none; }
  table.grid.stack tbody td.wrap { min-width: 0; }
  table.grid.stack tbody td.mono { font-size: var(--fs-xs); }
  table.grid.stack tbody tr:hover { background: transparent; }
  /* left-to-right values keep their direction; only the label / value sides are swapped back */
  table.grid.stack tbody td.ltr { flex-direction: row-reverse; text-align: left; }
  table.grid.stack tbody td.mono::before { font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif; }
}
/* file picker with a Hebrew button (forms.js fileField) */
.file-field { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; position: relative; cursor: pointer; color: var(--text); font-size: var(--fs-md); }
.file-field .file-native { position: absolute; inset-inline-start: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-field:hover .btn { background: var(--hover); border-color: var(--border-strong); }
.file-field:focus-within .btn { box-shadow: var(--ring); border-color: var(--primary); }
.file-name { overflow-wrap: anywhere; min-width: 0; }
div.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.field-row { display: flex; gap: var(--space-4); flex-wrap: wrap; align-items: flex-start; }
.field-row > .grow { flex: 1 1 260px; min-width: 0; }
.token-hints { display: grid; gap: 2px; }
.token-hints code { font-family: var(--mono); background: var(--badge-bg); padding: 0 5px; border-radius: 4px; }
/* page-level tabs sit right under the page head */
/* updates */
.card-body > .tiles { box-shadow: none; }
/* add computers */
.ok-box { background: var(--success-soft); color: var(--success-text); padding: 10px 14px; border-radius: 8px; }
.steps > li::marker { font-weight: 700; color: var(--primary); }
.nowrap { white-space: nowrap; }

/* ============================================================================================
   New look 2026-11b: the computer page's style on every page. Borderless soft cards, rounder
   corners, larger headings, pill tabs, airy tables. Only shared furniture is restyled here.
   ============================================================================================ */
:root { --radius-sm: 10px; --radius: 12px; --radius-lg: 18px; --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .07);
  --card-edge: var(--border); --ctl-edge: color-mix(in srgb, var(--border-strong) 55%, var(--border)); --track: color-mix(in srgb, var(--border) 70%, var(--surface-2)); }
:root[data-theme=dark] { --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25); }
.main { padding: 28px 32px 48px; }
.card { border-color: var(--card-edge); }
.card-head { border-bottom-color: color-mix(in srgb, var(--border) 60%, transparent); padding: var(--space-4) 22px; min-height: 60px; }
.card-head h2 { font-size: 17px; font-weight: 650; }
.card-body { padding: var(--space-5) 22px; }
.card + .card, .tiles + .card { margin-top: var(--space-5); }
.btn { border-radius: var(--radius-sm); font-weight: 600; box-shadow: none; }
.btn:not(.primary):not(.danger):not(.ghost) { border-color: var(--ctl-edge); background: var(--surface); }
.btn:not(.primary):not(.danger):not(.ghost):hover:not(:disabled) { background: var(--hover); border-color: var(--border-strong); }
.seg { padding: 4px; border-radius: 14px; border-color: var(--ctl-edge); background: var(--track); }
.seg-btn { color: var(--text); }
.seg-btn.active { box-shadow: 0 0 0 1px var(--ctl-edge), var(--shadow); }
.seg-btn { height: 32px; padding: 0 16px; border-radius: 10px; font-size: var(--fs-md); font-weight: 550; }
.dev2-tabs .seg-btn { height: 38px; }
.toolbar { border-bottom-color: color-mix(in srgb, var(--border) 60%, transparent); padding: var(--space-4) 22px; }
table.grid th, table.grid td { padding: 13px 14px; border-bottom-color: color-mix(in srgb, var(--border) 55%, transparent); }
table.grid th { background: transparent; height: 44px; font-size: var(--fs-sm); letter-spacing: 0; }
table.grid th:first-child, table.grid td:first-child { padding-inline-start: 22px; }
table.grid th:last-child, table.grid td:last-child { padding-inline-end: 22px; }
/* summary strips become separate glance tiles, like the computer page */
.tiles { gap: var(--space-4); overflow: visible; background: transparent; border: 0; box-shadow: none; border-radius: 0; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tiles { margin-bottom: var(--space-5); }
.stat, .tiles > .card.tile { border: 1px solid var(--card-edge); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); padding: 16px 18px; }
.tile .value { font-size: 24px; font-weight: 700; }
.tile .label { font-size: var(--fs-sm); }
.stat.clickable:hover, .tiles > .card.tile[style*="cursor"]:hover { background: var(--surface); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat.active { background: var(--primary-soft); box-shadow: 0 0 0 2px var(--primary); }
.tiles > .card.tile { min-height: 84px; }
.card-body > .tiles > .card.tile { background: var(--surface-2); box-shadow: none; }
.tile.green .value, .tile.online .value { color: var(--success-text); }
.tile.red .value { color: var(--danger-text); }
.tile.amber .value { color: var(--warning-text); }
.actionbar { border-color: var(--card-edge); border-radius: var(--radius-lg); padding: 8px 10px; }
.pc-tile { border-radius: 16px; }
.side-count { color: var(--sidebar-text); }
.btn:disabled { opacity: .6; }
.modal { border-radius: 20px; }
.modal > .card-head { border-radius: 20px 20px 0 0; }
.modal-foot { border-radius: 0 0 20px 20px; }
@media (max-width: 760px) {
  .main { padding: 18px 14px 40px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
  .stat, .tiles > .card.tile { padding: 12px 14px; }
  .tile .value { font-size: 20px; }
}

/* Remote access: hub-identity pinning box on the remote login page, and the enrolment code lists. */
.ident-box { border: 1px solid var(--border-strong); border-radius: 8px; padding: 10px 12px; margin: 6px 0 2px; font-size: 13px; }
.ident-box.warn { background: var(--warning-soft); border-color: var(--warning); color: var(--warning-text); }
.ident-box.bad { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.ident-box code { font-family: ui-monospace, Menlo, Consolas, monospace; }
.codes div { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---- saved / biometric login ---- */
.login-card [hidden], .trusted-list [hidden], .trusted-tools [hidden], .trusted-add [hidden] { display: none !important; }
.login-fields { display: grid; gap: var(--space-4); min-width: 0; }
.login-fields > * { min-width: 0; }
.login-wait { display: flex; align-items: center; justify-content: center; gap: 10px; padding: var(--space-6) 0; color: var(--muted); font-size: var(--fs-lg); }
.login-wait::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--primary); animation: login-spin .8s linear infinite; flex: none; }
@keyframes login-spin { to { transform: rotate(360deg); } }
.login-card .btn.login-bio { width: 100%; height: 44px; gap: 8px; font-size: 15px; white-space: normal; line-height: 1.2; color: var(--primary-soft-text); background: var(--primary-soft); border-color: var(--primary-border); }
.login-card .btn.login-bio:hover:not(:disabled) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 16%, var(--surface)); }
.login-card .btn.login-bio svg.icon { width: 20px; height: 20px; margin: 0; }
.login-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: var(--fs-xs); }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-checks { display: grid; gap: 6px; }
.login-card .check-row { padding: 2px 0; font-size: 13.5px; line-height: 1.4; }
.login-card .check-row > span { min-width: 0; }
.login-hint { display: block; margin-top: 1px; font-size: var(--fs-xs); color: var(--muted); }
.login-note { font-size: var(--fs-xs); color: var(--muted); text-align: center; line-height: 1.5; }
.error-text.login-info { color: var(--muted); }
/* "Approve on the phone": the number to tap in the Telegram message. */
.login-push { display: grid; gap: 10px; justify-items: center; text-align: center; padding: var(--space-2) 0; }
.login-push-title { font-size: var(--fs-lg); font-weight: 700; }
.login-push-number { direction: ltr; font-size: 52px; line-height: 1.1; font-weight: 700; letter-spacing: 6px; font-variant-numeric: tabular-nums; color: var(--primary-soft-text); background: var(--primary-soft); border: 1px solid var(--primary-border); border-radius: 14px; padding: 10px 26px; }
.login-push-text { font-size: 15px; }
.login-push-left { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.login-push .btn.login-push-other { margin-top: 4px; }
.login-fields .error-text:empty { display: none; }

.trusted-list { display: grid; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.trusted-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); min-width: 0; }
.trusted-row:last-child { border-bottom: 0; }
.trusted-row.current { background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.trusted-icon { flex: none; width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-soft-text); }
.trusted-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.trusted-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.trusted-title { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.trusted-meta { display: flex; flex-wrap: wrap; column-gap: 6px; row-gap: 2px; font-size: var(--fs-xs); color: var(--muted); }
.trusted-meta > span + span::before { content: "\00B7"; margin-inline-end: 6px; }
.trusted-meta .mono { unicode-bidi: isolate; font-size: 11.5px; }
.trusted-remove { flex: none; }
.trusted-empty { padding: var(--space-6) var(--space-4); text-align: center; color: var(--muted); }
.trusted-tools { display: flex; justify-content: flex-end; }
.trusted-tools:not(:has(> :not([hidden]))) { display: none; }
.trusted-add { border-top: 1px solid var(--border); padding-top: 14px; }
.trusted-add:empty { display: none; }
.trusted-add-form { display: grid; gap: 10px; }
.trusted-add-form .error-text:empty { display: none; }
.trusted-add-row { display: flex; flex-wrap: wrap; gap: 8px; }
.trusted-add-row .btn { white-space: normal; height: auto; min-height: var(--ctl-h); padding-block: 6px; line-height: 1.25; }
.trusted-note { font-size: var(--fs-xs); color: var(--muted); line-height: 1.5; }
@media (max-width: 480px) {
  .login-card .card-body { padding: 26px 20px; }
  .trusted-row { flex-wrap: wrap; }
  .trusted-main { flex-basis: calc(100% - 48px); }
  .trusted-remove { margin-inline-start: 48px; }
}

/* ============================================================================================
   Computer health (2026-11): #/health and the "בריאות" tab of a computer page. One calm list:
   icon, title + one sentence, and a single button (or "תקין") on the far side.
   ============================================================================================ */
.hl-card { padding: 0; overflow: hidden; }
.hl-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 18px 24px 8px; min-height: 60px; }
.hl-head-title { font-weight: 700; font-size: var(--fs-xl); display: inline-flex; align-items: center; gap: 10px; }
.hl-row { display: flex; align-items: center; gap: var(--space-4); padding: 16px 24px; }
.hl-row + .hl-row, .hl-head + .hl-row { border-top: 1px solid var(--border); }
.hl-head + .hl-row { border-top: 0; }
.hl-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.hl-ic svg.icon { width: 20px; height: 20px; }
.hl-ic.ok { background: var(--success-soft); color: var(--success-text); }
.hl-ic.warn { background: var(--warning-soft); color: var(--warning-text); }
.hl-ic.bad { background: var(--danger-soft); color: var(--danger-text); }
.hl-ic.muted { background: var(--surface-2); color: var(--muted); }
.hl-ic.big { width: 56px; height: 56px; border-radius: 16px; }
.hl-ic.big svg.icon { width: 28px; height: 28px; }
.hl-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; color: inherit; }
a.hl-link:hover { text-decoration: none; }
a.hl-link:hover .hl-title { color: var(--primary); }
.hl-title { font-weight: 650; font-size: var(--fs-lg); }
.hl-sub { color: var(--muted); font-size: var(--fs-md); overflow-wrap: anywhere; }
.hl-row > .btn { min-width: 132px; justify-content: center; flex: none; }
.hl-ok { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--muted); flex: none; white-space: nowrap; }
.hl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.hl-busy { display: inline-flex; align-items: center; gap: 8px; color: var(--primary); font-weight: 600; font-size: var(--fs-sm); flex: none; }
.hl-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--primary-soft); border-top-color: var(--primary); animation: hl-spin 0.9s linear infinite; }
@keyframes hl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hl-spin { animation: none; } }
.hl-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding: 14px 24px; color: var(--muted); font-size: var(--fs-md); border-top: 1px solid var(--border); }
.hl-foot + .hl-row { border-top: 1px solid var(--border); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-align: start; }
.linklike:hover { text-decoration: underline; }
.hl-tab-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-inline-start: 7px; vertical-align: 2px; background: var(--warning); }
.hl-tab-dot.bad { background: var(--danger); }
.hl-more { margin-top: 4px; font-size: var(--fs-sm); }
.hl-more summary { cursor: pointer; color: var(--primary); }
.hl-more ul { margin: 6px 0 0; padding-inline-start: 18px; text-align: left; }
.hl-log { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; display: grid; gap: 6px; font-size: var(--fs-md); }
.hl-confirm { display: grid; gap: 6px; }
/* A repair in detail: the running job, or how the last one ended. */
.hl-job { margin: 4px 24px 16px; padding: 18px 20px; border-radius: var(--radius); background: var(--primary-soft); display: grid; gap: 10px; }
.hl-job.hl-result.ok { background: var(--success-soft); }
.hl-job.hl-result.bad { background: var(--warning-soft); }
.modal .hl-job { margin: 0; }
.hl-job-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.hl-job-title { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: var(--fs-lg); }
.hl-job-pos { font-weight: 600; font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
.hl-job-now { font-size: var(--fs-md); overflow-wrap: anywhere; }
.hl-job-facts, .hl-job-note { color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; }
.hl-steps { display: grid; background: var(--surface); border-radius: var(--radius-sm); padding: 4px 14px; }
.hl-steps > .hl-job-facts { padding: 8px 0 2px; }
.hl-step { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; }
.hl-step + .hl-step { border-top: 1px solid var(--border); }
.hl-step > .hl-spin, .hl-step > .hl-mark { margin-top: 3px; }
.hl-mark { width: 18px; height: 18px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 700; line-height: 1; border: 2px solid var(--border-strong); color: transparent; }
.hl-step.done > .hl-mark, .hl-result.ok .hl-job-title > .hl-mark { background: var(--success); border-color: var(--success); color: #fff; }
.hl-step.failed > .hl-mark, .hl-result.bad .hl-job-title > .hl-mark { background: var(--warning); border-color: var(--warning); color: #fff; }
.hl-step.skipped > .hl-mark { color: var(--muted); }
.hl-step > .hl-spin { width: 18px; height: 18px; flex: none; }
.hl-step-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.hl-step-title { font-weight: 600; }
.hl-step.pending .hl-step-title, .hl-step.skipped .hl-step-title { font-weight: 400; color: var(--muted); }
.hl-step-text { color: var(--muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.hl-step.running .hl-step-text { color: var(--text); }
.hl-step-time { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; flex: none; }
.hl-journal > summary { cursor: pointer; color: var(--primary); font-size: var(--fs-sm); font-weight: 600; }
.hl-journal > .hl-log { margin-top: 8px; background: var(--surface); max-height: 320px; overflow: auto; font-size: var(--fs-sm); }
.hl-log-line { display: flex; gap: 12px; align-items: baseline; }
.hl-log-at { color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.hl-row + .hl-head { border-top: 1px solid var(--border); }
@media (max-width: 640px) {
  .hl-job { margin-inline: 12px; padding: 14px; }
  .hl-step { flex-wrap: wrap; }
  .hl-step-time { flex-basis: 100%; margin-inline-start: 30px; white-space: normal; }
}
/* nightly maintenance dialog */
.hl-sched, .hl-sched-body { display: grid; gap: 16px; }
.hl-switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.hl-switch > input { position: absolute; opacity: 0; width: 0; height: 0; }
.hl-switch-track { flex: none; width: 42px; height: 24px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .15s; margin-top: 2px; }
.hl-switch-track::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: inset-inline-start .15s; }
.hl-switch > input:checked + .hl-switch-track { background: var(--primary); }
.hl-switch > input:checked + .hl-switch-track::after { inset-inline-start: 21px; }
.hl-switch > input:focus-visible + .hl-switch-track { box-shadow: var(--ring); }
.hl-sched-line { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.hl-sched .field { display: grid; gap: 6px; font-size: var(--fs-sm); font-weight: 600; }
.hl-sched .field > select, .hl-sched .field > input { font-weight: 400; }
.hl-days { display: flex; gap: 6px; flex-wrap: wrap; }
.hl-day { padding: 0; width: var(--ctl-h); justify-content: center; }
.hl-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 14px; max-height: 180px; overflow: auto; padding: 4px 2px; }
.hl-adv > summary { cursor: pointer; color: var(--primary); font-size: var(--fs-md); margin-bottom: 8px; }
.hl-note, .hl-last { font-size: var(--fs-sm); line-height: 1.5; }
@media (max-width: 640px) {
  .hl-row { flex-wrap: wrap; padding: 14px 16px; gap: var(--space-3); }
  .hl-main { flex-basis: calc(100% - 60px); }
  .hl-row > .btn, .hl-row > .hl-busy, .hl-row > .hl-ok { margin-inline-start: 58px; }
  .hl-head, .hl-foot { padding-inline: 16px; }
}
.hl-sched input[type=time] { height: var(--ctl-h); padding: 0 10px; border: 1px solid var(--ctl-edge, var(--border-strong)); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; min-width: 120px; }


/* Sign-in hardening: the "code inside the school too" row under the two-step card */
.lan-code { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.push-row-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.push-row-head strong { font-weight: 600; }
.push-row .btn { margin-top: 10px; }

/* ---- Rooms inside rooms, and dragging PCs between rooms ---- */
/* Side menu: a room inside another room is indented under it. */
/* Room view: the rooms inside this one, as chips under the title. */
.subroom-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-3); font-size: var(--fs-sm); }
.subroom-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600;
}
.subroom-chip:hover { text-decoration: none; border-color: var(--primary); color: var(--primary); }
.subroom-chip svg.icon { width: 15px; height: 15px; color: var(--muted); }
.subroom-count { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
/* Dragging: the tile being dragged fades, and every place that takes it is outlined while the mouse is over it. */
.pc-tile[draggable=true] { -webkit-user-drag: element; }
.drag-source { opacity: .45; }
.drop-on { outline: 2px dashed var(--primary); outline-offset: 2px; }
#rooms a.drop-on { outline-color: #5EEAD4; outline-offset: -2px; background: var(--sidebar-hover); }
body.pc-dragging .subroom-chip { border-style: dashed; }

/* ---- computers page: PCs that wait for approval, and one short summary row on a phone ---- */
.dot.wait { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.pending-note { justify-self: start; display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 12px; border-radius: 999px; background: var(--warning-soft); color: var(--warning-text); font-size: var(--fs-sm); font-weight: 600; }
.pending-note[hidden] { display: none; }
.pending-note::after { content: "‹"; font-size: 15px; line-height: 1; }
.pending-note:hover { text-decoration: underline; }
.side-count.wait { color: #FBBF24; background: rgba(245, 158, 11, .16); }
.side-count.wait[hidden] { display: none; }
.screen-link { color: inherit; text-decoration: underline; opacity: .9; }

/* ---- power page: two tabs (sleep settings, timetable) ---- */

/* ---- a page that did not load, and the folded part of the package dialog ---- */
.load-error { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); }
.load-error-why { font-size: var(--fs-sm); direction: ltr; unicode-bidi: plaintext; overflow-wrap: anywhere; }
.pkg-advanced > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.pkg-advanced > .form-grid { margin-top: var(--space-3); }

/* ---- audit log: search, kind filter, "show more" ---- */

/* ============================================================================================
   Phone comfort (the last word on a phone-size screen; ui.css has the part for the shared components)
   ============================================================================================ */
@media (max-width: 760px) {
  /* Everything that is pressed is tall enough for a finger. */
  :root { --ctl-h: 42px; --ctl-h-sm: 38px; }
  .seg-btn { height: 36px; padding: 0 12px; }
  .dev2-tabs .seg-btn { height: 40px; padding: 0 9px; }
  .sel-all { height: 34px; padding: 0 12px; }
  .actionbar.fold-1 .seg-lock .abtn, .actionbar.fold-2 .abtn:not(.accent):not(.dd-trigger),
  .actionbar.fold-3 .abtn:not(.dd-trigger), .actionbar.fold-3 .abtn { width: var(--abtn-w, 37px); height: 40px; }
  .actionbar.fold-3, .actionbar.fold-3 .abtn-group:not(.seg-lock) { gap: 3px; }
  .actionbar.fold-3 .sel-all { padding: 0 10px; }
  .tile-check { width: 30px; height: 30px; }
  .tile-check svg.icon { width: 16px; height: 16px; }
  input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }
  .menu-item { min-height: 44px; }
  .icon-btn { min-width: 40px; min-height: 40px; }
  /* The browser's own bars change the height of the screen: a window's title and its buttons stay on the screen,
     and the end of the side menu is not under the bar. */
  .modal { max-height: calc(100dvh - 16px); }
  .sidebar { height: auto; }
}
@media (max-width: 380px) { :root { --abtn-w: 34px; } }
/* An iPhone zooms the whole page in when a field with small letters is tapped, and does not zoom back. */
@media (max-width: 760px) and (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea { font-size: 16px !important; }
}
/* The computers as a table, on a phone: a list, two short lines per computer (name and user, room and disk
   protection) with the checkbox at its start. The other columns are on the computer's own page. */
@media (max-width: 760px) {
  .table-wrap:has(> table.pc-table) { overflow-x: visible; }
  table.grid.pc-table, table.grid.pc-table tbody { display: block; }
  table.grid.pc-table thead { display: none; }
  table.grid.pc-table tbody tr { display: grid; grid-template-columns: 36px 10px minmax(0, 1fr) auto; align-items: center; gap: 2px var(--space-2);
    min-height: 56px; padding: 6px var(--space-3); border-bottom: 1px solid var(--border); }
  table.grid.pc-table tbody tr:last-child { border-bottom: 0; }
  table.grid.pc-table tbody td { display: none; padding: 0; border: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  table.grid.pc-table tbody td:nth-child(-n+5), table.grid.pc-table tbody td:nth-child(11) { display: block; }
  table.grid.pc-table tbody td:nth-child(1) { grid-column: 1; grid-row: 1 / 3; width: auto; display: grid; place-items: center; align-self: stretch; overflow: visible; }
  table.grid.pc-table tbody td:nth-child(2) { grid-column: 2; grid-row: 1 / 3; overflow: visible; }
  table.grid.pc-table tbody td:nth-child(3) { grid-column: 3; grid-row: 1; font-size: var(--fs-lg); }
  table.grid.pc-table tbody td:nth-child(5) { grid-column: 4; grid-row: 1; max-width: 42vw; font-size: var(--fs-sm); color: var(--muted); direction: ltr; }
  table.grid.pc-table tbody td:nth-child(4) { grid-column: 3; grid-row: 2; font-size: var(--fs-sm); color: var(--muted); }
  table.grid.pc-table tbody td:nth-child(11) { grid-column: 4; grid-row: 2; justify-self: end; }
  table.grid.pc-table tbody td:nth-child(4):empty, table.grid.pc-table tbody td:nth-child(11):empty { display: none; }
  /* The tabs of a computer's page: all in sight, in two rows when they do not fit in one. */
  .dev2-tabs { flex-wrap: wrap; overflow-x: visible; gap: 2px; }
  .dev2-tabs .seg-btn { flex: 1 1 30%; }
}

/* ---- Phones and tablets, part 3: iPad widths, the panel from the home screen ----
   A wide table scrolls inside its own frame. The frame is the containing block of what sits in its cells, so a
   hidden label far out in a wide row can no longer widen the whole page (on an iPad that made every page with a
   wide table pan sideways and pulled the side menu into view). */
.table-wrap, .ui-table-wrap { position: relative; }
@media (max-width: 1180px) {
  /* nothing may pan the page sideways under the bar that stays on top; clip keeps "sticky" working */
  .workspace { overflow-x: clip; }
  /* opened from the home screen the page reaches under the clock and around the notch */
  .mobilebar { height: calc(52px + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px);
    padding-inline: max(14px, env(safe-area-inset-left, 0px)) max(14px, env(safe-area-inset-right, 0px)); }
  .actionbar { top: calc(52px + env(safe-area-inset-top, 0px)); }
  .sidebar { padding-top: env(safe-area-inset-top, 0px); }
  .rail { padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
  .main { padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
    padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
}
@media (max-width: 760px) {
  .main { padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
}
.login-page { min-height: 100dvh; padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px)); }
/* a tablet is used with a finger: the same comfortable sizes as on a phone, the layout stays the wide one */
@media (min-width: 761px) and (max-width: 1180px) and (pointer: coarse) {
  :root { --ctl-h: 42px; --ctl-h-sm: 38px; }
  .menu-item { min-height: 44px; }
  .icon-btn { min-width: 40px; min-height: 40px; }
  input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px !important; }
}
/* The header row of a list does not follow the scroll. Inside a frame that scrolls sideways it never could, and
   Safari on an iPhone or iPad moved it down over the rows while the page scrolled. */
.table-wrap table.grid th { position: static; }
@media (max-width: 1180px) { table.grid th { position: static; } }

/* The note on the computers screen when some are hidden in the side menu (shownpcs.js). */
.hidden-pcs-text { display: inline-flex; align-items: center; gap: 8px; }
.hidden-pcs-text svg.icon { width: 16px; height: 16px; flex: none; }

/* ============================================================================================
   The head of the computers page (views/devices.js): two rows that stay at the top while the computers scroll
   under them. Row one: title, room, search, the state filter with its counts, two more counts, the view. Row two:
   one card with the actions. On a phone the rows stand on the page and only the actions stay.
   ============================================================================================ */
.devhead { position: sticky; top: 0; z-index: 30; display: grid; gap: 10px; padding-top: var(--head-pad); margin-top: calc(-1 * var(--head-pad)); }
/* the page's own colour around the head, so the computers pass under it cleanly and never show above it */
.devhead::before { content: ''; position: absolute; inset: 0 -32px -10px; /* no wider than the page's own margin, or the page could be pushed sideways */ z-index: -1; pointer-events: none; background: var(--bg); }
.devhead-top { flex-wrap: nowrap; margin: 0; min-width: 0; }
.devhead-top .ui-head { flex: 0 0 auto; max-width: 40%; min-width: 0; margin-inline-end: var(--space-2); align-items: center; }
.devhead-top .ui-head-text { flex: 0 1 auto; min-width: 0; }
.devhead-top .ui-head h1 { font-size: 26px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.devhead-top .ui-head-sub { margin-top: 2px; font-size: var(--fs-sm); }
.devhead-top .ui-head-back { margin-bottom: 2px; }
.devhead-top .search-box { flex: 1 1 220px; min-width: 150px; max-width: none; }
.devhead-top .room-select { flex: none; width: 190px; min-width: 0; max-width: none; }
.devhead-top > .seg { flex: none; }
.devhead-top > .seg .seg-label { display: none; }
.devhead-top > .seg .seg-btn { padding-inline: 11px; }
.search-count { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); pointer-events: none;
  padding: 3px 9px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-soft-text);
  font-size: 12px; font-weight: 600; white-space: nowrap; }
.search-count:empty { display: none; }
.search-box input.with-count { padding-inline-end: 150px; }
/* the state filter: one control, three buttons, each with its count */
.devhead-filter { display: inline-flex; flex: none; gap: 2px; padding: 3px; height: var(--ctl-h); border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.devhead-filter-btn { display: inline-flex; align-items: center; gap: 6px; padding: 0 11px; border: 0; border-radius: calc(var(--radius) - 3px);
  background: transparent; color: var(--muted); font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer; transition: background-color .12s, color .12s; }
.devhead-filter-btn > b { color: var(--text); font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; }
.devhead-filter-btn > i { width: 7px; height: 7px; border-radius: 50%; background: var(--grey); flex: none; }
.devhead-filter-btn.ok > i { background: var(--success); }
.devhead-filter-btn:hover:not(.on) { background: var(--hover); color: var(--text); }
.devhead-filter-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.devhead-filter-btn.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(10, 27, 46, .14); }
.devhead-facts { display: inline-flex; flex: none; gap: var(--space-3); color: var(--muted); font-size: 13px; white-space: nowrap; }
.devhead-fact { display: inline-flex; align-items: baseline; gap: 5px; cursor: default; }
.devhead-fact > b { color: var(--text); font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; }
/* the tile options beside the view: "מחוברים תחילה" as its icon (the words are its tooltip), the size as a short slider */
.devhead-top .tile-only { flex: none; gap: 6px; }
.devhead-top .tile-only.hidden { display: flex !important; visibility: hidden; } /* keeps its place: the row does not move when the view changes */
.devhead-top .chip-label { display: none; }
.devhead-top .chip { width: var(--ctl-h); padding: 0; justify-content: center; }
.devhead-top .chip.active { background: var(--primary-soft); border-color: var(--primary); }
.devhead-top .chip.active svg.icon { color: var(--primary); }
.devhead-top .size-ctl input[type=range] { width: 64px; }
/* row two: the actions in one card */
.devhead-bar { min-width: 0; padding: 7px 10px;
  background: var(--surface); border: 1px solid var(--card-edge, var(--border)); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); transition: box-shadow .2s var(--ease, ease); }
.devhead.stuck .devhead-bar { box-shadow: 0 1px 2px rgba(10, 27, 46, .06), 0 14px 32px -18px rgba(10, 27, 46, .35); }
.devhead-bar .actionbar { position: static; margin: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; backdrop-filter: none; }
/* Narrower desktops: the first row wraps once, title and view above, search and filters under them. */
@media (max-width: 1700px) {
  .devhead-top { flex-wrap: wrap; row-gap: 10px; }
  /* the title takes the rest of line one beside the view, so search and filters move to line two together */
  .devhead-top .ui-head { flex: 1 0 calc(100% - 330px); max-width: none; }
  .devhead-top .search-box { order: 1; max-width: none; flex: 1 1 260px; }
  .devhead-top .room-select, .devhead-top .devhead-filter, .devhead-top .devhead-facts, .devhead-top .count { order: 1; }
  .devhead-top > .seg, .devhead-top .tile-only { order: 0; }
}
@media (max-width: 1180px) {
  .devhead { top: calc(52px + env(safe-area-inset-top, 0px)); }
  .devhead::before { inset-inline: -18px; }
}
/* A phone: the head would cover half the screen. Its rows stand on the page, and only the actions stay. */
@media (max-width: 760px) {
  .devhead { display: contents; }
  .devhead::before { display: none; }
  .devhead-top .ui-head { flex: 1 1 100%; margin: 0; }
  .devhead-top .search-box { flex: 1 1 100%; }
  .devhead-top .room-select { flex: 1 1 100%; max-width: none; }
  .devhead-filter { flex: 1 1 100%; }
  .devhead-filter-btn { flex: 1 1 auto; justify-content: center; padding: 0 6px; }
  .devhead-top > .seg { order: 2; margin-inline-start: 0; }
  .devhead-top > .seg .seg-label { display: inline; }
  .devhead-bar { position: sticky; top: calc(52px + env(safe-area-inset-top, 0px)); z-index: 30;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(8px); }
  .devhead-top .tile-only { order: 2; }
  .devhead-top .tile-only.hidden { display: none !important; }
}

/* ============================================================================================
   Nothing moves when something is pressed or chosen
   ============================================================================================ */
/* A chosen tab or filter is shown by its background and colour, not by heavier letters: heavier letters are wider and
   push everything after them sideways. */
.seg-btn.active { font-weight: 550; }
.dev2-tabs .seg-btn.active { font-weight: 600; }
/* A box that scrolls keeps the room of its scroll bar even when it does not need one, so its contents do not jump
   sideways when a group opens or closes or the contents grow (the side menu, a window, a side panel). */
@media (min-width: 1181px) {
  .sidebar { scrollbar-gutter: stable; }
}
.modal, .drawer-body { scrollbar-gutter: stable; }

/* ============================================================================================
   The head of a computer's page: a slim dark band with the name, its state and facts, the actions, the live
   picture, and the tabs along its foot. It stays on top while the page scrolls (on a phone it stands on the page).
   Nothing in it changes size when the computer changes state, so the page under it never moves.
   ============================================================================================ */
.dev2 .crumbs { margin-bottom: -6px; }
.dev2-head { position: sticky; top: 0; z-index: 30; padding-top: var(--head-pad); margin-top: calc(-1 * var(--head-pad)); }
.dev2-head::before { content: ''; position: absolute; inset: 0 -32px -10px; /* no wider than the page's own margin */ z-index: -1; pointer-events: none; background: var(--bg); }
.dev2-band { --band-fg: #fff; display: grid; grid-template-columns: minmax(0, 1fr) 196px; gap: 0 28px; align-items: center;
  padding: 16px 22px 0; border-radius: 20px; color: var(--band-fg); box-shadow: var(--shadow-lg);
  background: linear-gradient(120deg, var(--sidebar-bg) 0%, var(--primary) 100%); transition: box-shadow .2s var(--ease, ease); }
:root[data-theme=dark] .dev2-band { --band-fg: var(--text); background: linear-gradient(120deg, var(--surface-2) 0%, color-mix(in srgb, var(--primary) 40%, var(--surface)) 100%); }
.dev2-head.stuck .dev2-band { box-shadow: 0 18px 40px -20px rgba(10, 27, 46, .55); }
.dev2-band-main { display: grid; gap: 10px; min-width: 0; padding-bottom: 16px; }
.dev2-band-shot { min-width: 0; padding-bottom: 16px; }
.dev2-band .device-shot { border-radius: 10px; box-shadow: 0 14px 30px rgba(0, 0, 0, .35); }
.dev2-band .shot-open { display: none; }
/* name, state, badges: one line, the name gives way first */
.dev2-band .dev-hero-title { flex-wrap: nowrap; gap: 10px; min-width: 0; }
.dev2-band .dev-hero-title h1 { font-size: 28px; font-weight: 700; letter-spacing: -.01em; color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; min-width: 0; }
.dev2-band .dev-hero-title > :not(h1) { flex: none; }
.dev2-band .dev-badges { display: inline-flex; gap: 6px; min-width: 0; overflow: hidden; flex: 0 1 auto !important; }
.dev2-band .dev-badges .badge { white-space: nowrap; }
.dev2-band .dev-state, .dev2-band .dev-state.on { height: 26px; padding: 0 11px; background: color-mix(in srgb, #000 24%, transparent); color: var(--band-fg); }
/* facts: icon and value; the label is read aloud and shows on hover */
.dev2-band .dev-facts { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13.5px; }
.dev2-band .dev-fact { gap: 6px; min-width: 0; }
.dev2-band .dev-fact > svg.icon { width: 15px; height: 15px; color: inherit; opacity: .75; }
.dev2-band .dev-fact-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dev2-band .dev-fact-value { font-weight: 500; white-space: nowrap; }
.dev2-band .dev-fact a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--band-fg) 45%, transparent); text-underline-offset: 3px; }
/* actions */
.dev2-band .dev-actions { flex-wrap: nowrap; gap: 8px; padding: 2px 0 0; border: 0; }
.dev2 .dev2-band .dev-actions .btn { height: 38px; padding: 0 14px; gap: 7px; border-radius: 11px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent; background: color-mix(in srgb, var(--band-fg) 14%, transparent); color: var(--band-fg); }
.dev2 .dev2-band .dev-actions .btn:hover:not(:disabled) { background: color-mix(in srgb, var(--band-fg) 24%, transparent); border-color: color-mix(in srgb, var(--band-fg) 30%, transparent); }
.dev2 .dev2-band .dev-actions .btn svg.icon { width: 16px; height: 16px; margin: 0; color: inherit; }
.dev2 .dev2-band .dev-actions .btn.primary { background: #fff; color: var(--primary-soft-text); }
.dev2 .dev2-band .dev-actions .btn.primary svg.icon { color: var(--primary); }
.dev2 .dev2-band .dev-actions .btn.primary:hover:not(:disabled) { background: var(--primary-soft); border-color: transparent; }
:root[data-theme=dark] .dev2 .dev2-band .dev-actions .btn.primary { background: var(--primary); color: var(--on-primary); }
:root[data-theme=dark] .dev2 .dev2-band .dev-actions .btn.primary svg.icon { color: inherit; }
.dev2 .dev2-band .dev-actions .btn:disabled { opacity: .55; }
.dev2-band .dev-actions .dd-chev { display: none; }
.dev2 .dev2-band .dev-actions .dev-act { min-width: 108px; justify-content: center; } /* lock and unlock swap in place without moving the rest */
.dev2-band .dd-menu { color: var(--text); }
/* tabs along the foot of the band */
.dev2-band-tabs { grid-column: 1 / -1; margin: 0 -22px; padding: 0 12px; border-top: 1px solid color-mix(in srgb, var(--band-fg) 16%, transparent); min-width: 0; }
.dev2-band .dev2-tabs { display: flex; gap: 2px; max-width: 100%; }
.dev2 .dev2-band .dev2-tabs .seg-btn { height: 44px; padding: 0 16px; border-radius: 0; background: none; box-shadow: none; font-size: var(--fs-md); font-weight: 600;
  color: color-mix(in srgb, var(--band-fg) 72%, transparent); border-bottom: 2px solid transparent; }
.dev2 .dev2-band .dev2-tabs .seg-btn:hover:not(.active) { color: var(--band-fg); }
.dev2 .dev2-band .dev2-tabs .seg-btn:focus-visible { outline: 2px solid var(--band-fg); outline-offset: -4px; border-radius: 8px; }
.dev2 .dev2-band .dev2-tabs .seg-btn.active { color: var(--band-fg); border-bottom-color: #3EE0C4; }
/* the cards under the head sit at the page's rhythm, not tucked under a tab row */
.dev2 .dev-list, .dev2 .dev-history { margin-top: 0; }
/* Narrower desktops: the four everyday actions keep only their icon (the name shows on hover). */
@media (max-width: 1400px) {
  .dev2-band .dev-actions .dev-act-label, .dev2-band .dev-actions .dd-trigger > span:not(.dd-chev) { display: none; }
  .dev2 .dev2-band .dev-actions .dev-act { width: 38px; min-width: 0; padding: 0; }
  .dev2 .dev2-band .dev-actions .dd-trigger { width: 38px; padding: 0; justify-content: center; }
}
@media (max-width: 1180px) {
  .dev2-head { top: calc(52px + env(safe-area-inset-top, 0px)); }
  .dev2-head::before { inset-inline: -18px; }
  .dev2-band { grid-template-columns: minmax(0, 1fr) 150px; gap: 0 20px; }
  .dev2-band .dev-hero-title h1 { font-size: 24px; }
}
@media (max-width: 900px) {
  .dev2-band-tabs { padding: 0 6px; }
  .dev2 .dev2-band .dev2-tabs .seg-btn { padding: 0 10px; }
}
/* A phone: the band stands on the page (it would cover half the screen). The picture comes first, the actions
   take the full width, and all the tabs show at once in rows. */
@media (max-width: 760px) {
  .dev2-head { position: static; margin-top: 0; padding-top: 0; }
  .dev2-head::before { display: none; }
  .dev2-band { grid-template-columns: minmax(0, 1fr); padding: 14px 14px 0; border-radius: 18px; }
  .dev2-band-shot { order: -1; padding-bottom: 12px; }
  .dev2-band-main { padding-bottom: 14px; }
  .dev2-band .dev-hero-title { flex-wrap: wrap; }
  .dev2-band .dev-hero-title h1 { font-size: 22px; flex: 0 1 auto; white-space: normal; overflow-wrap: anywhere; }
  .dev2-band .dev-facts { gap: 4px 12px; font-size: 13px; }
  .dev2-band .dev-fact-value { white-space: normal; overflow-wrap: anywhere; }
  .dev2-band .dev-actions { flex-wrap: wrap; }
  .dev2-band .dev-actions > .btn.primary { flex: 1 1 100%; justify-content: center; }
  .dev2-band .dev-actions > .btn.dev-act, .dev2-band .dev-actions > .dd { flex: 1 1 0; min-width: 0; }
  .dev2 .dev2-band .dev-actions .btn { height: 44px; }
  .dev2 .dev2-band .dev-actions .dev-act, .dev2 .dev2-band .dev-actions .dd-trigger { width: 100%; }
  .dev2-band-tabs { margin: 0 -14px; padding: 4px; }
  .dev2 .dev2-band .dev2-tabs { flex-wrap: wrap; }
  .dev2 .dev2-band .dev2-tabs .seg-btn { flex: 1 1 22%; height: 40px; padding: 0 4px; justify-content: center; }
}
