/* ============================================================================================
   AIO Control — panel styles. Light theme by default, [data-theme=dark] on <html> for dark.
   ============================================================================================ */
/* Brand palette "Deep Teal" (branding/tokens.css). Teal 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: #F2F6F5;
  --surface: #ffffff;
  --surface-2: #E9F0EF;
  --hover: #EDF3F2;
  --border: #D3DEDC;
  --border-strong: #748A86;
  --text: #0C1F1E;
  --muted: #4F6462;
  --primary: #0B766E;
  --primary-hover: #0A6A63;
  --primary-soft: #D9F2EE;
  --primary-border: #9AD5CC;
  --on-primary: #ffffff;
  --link: #0A6A63;                 /* brand colour as text on a surface */
  --primary-soft-text: #0A5A54;
  --brand-accent: #D98A0B;         /* 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: #8FA5A1;
  --badge-bg: #E9F0EF;
  --input-bg: #ffffff;
  --code-bg: #082522;
  --code-text: #DCEBE8;
  --toast-bg: #0C2B28;
  --scrim: rgba(4, 21, 19, .5);

  --sidebar-bg: #082522;
  --sidebar-bg-2: #0A2D29;
  --sidebar-text: #BFD6D2;
  --sidebar-muted: #7FA09B;
  --sidebar-hover: rgba(255, 255, 255, .06);
  --sidebar-active: #0F3D38;
  --sidebar-active-text: #ffffff;
  --sidebar-border: rgba(255, 255, 255, .07);

  /* tile "screens" */
  --screen-user: linear-gradient(140deg, #0A6A63 0%, #0F9186 55%, #17A99B 100%);
  --screen-idle: linear-gradient(140deg, #33474A 0%, #4A6163 100%);
  --screen-off: linear-gradient(140deg, #16211F 0%, #212E2C 100%);
  --screen-bezel: #142522;
  --tile-selected-bg: #EEF9F7;

  /* 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;
  --sidebar-w: 252px;

  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: #06110F;
  --surface: #0D1C1A;
  --surface-2: #142926;
  --hover: #16302C;
  --border: #1F3A36;
  --border-strong: #5A827C;
  --text: #E6F2F0;
  --muted: #94B0AB;
  --primary: #14B8A6;
  --primary-hover: #2DD4BF;
  --primary-soft: #0E3A35;
  --primary-border: rgba(20, 184, 166, .45);
  --on-primary: #03201C;           /* dark text on the bright teal button */
  --link: #3FD9C6;
  --primary-soft-text: #86EBDD;
  --brand-accent: #FBBF24;
  --success-text: #4ADE80;
  --danger-text: #F87171;
  --info: #7DB2FF;
  --info-soft: #10233F;
  --sidebar-text: #B3CCC7;
  --sidebar-active: #0F332F;
  --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: #5F7672;
  --badge-bg: #172E2A;
  --input-bg: #081614;
  --code-bg: #030908;
  --code-text: #D7E8E4;
  --toast-bg: #16302C;
  --scrim: rgba(0, 0, 0, .6);

  --sidebar-bg: #040C0B;
  --sidebar-bg-2: #061412;
  --sidebar-border: rgba(255, 255, 255, .06);

  --screen-user: linear-gradient(140deg, #075049 0%, #0B766E 55%, #0E8C82 100%);
  --screen-idle: linear-gradient(140deg, #1B2B29 0%, #283B38 100%);
  --screen-off: linear-gradient(140deg, #060C0B 0%, #0C1514 100%);
  --screen-bezel: #040908;
  --tile-selected-bg: #0F2A27;

  --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; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40;
  display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: var(--sidebar-text);
  border-inline-end: 1px solid var(--sidebar-border);
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 14px; }
.brand-logo { width: 36px; height: 36px; flex: none; display: block; border-radius: 9px; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 16px; color: #fff; letter-spacing: .01em; }
.brand-sub { font-size: 12px; color: var(--sidebar-muted); }

.side-section { padding: 4px 10px; }
.side-title {
  font-size: 11.5px; font-weight: 600; letter-spacing: .06em; color: var(--sidebar-muted);
  padding: 10px 10px 6px;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.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: #5EEAD4; }
.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; }
.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); }

.side-foot {
  margin-top: auto; padding: 12px 14px 14px; border-top: 1px solid var(--sidebar-border);
  display: grid; gap: 10px; font-size: 13px;
}
.side-user { display: flex; align-items: center; gap: 6px; }
.side-user .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #e2e8f0; font-weight: 600; }
.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); }
.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; }
.mobilebar { display: none; }
.scrim { display: none; }
.main { padding: 22px 26px 40px; width: 100%; max-width: 1920px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }

/* ============================================================================================
   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); }
.sys-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 3px 0; }

.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); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); }
.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 */
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; }
dl.kv { display: grid; grid-template-columns: max-content 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;
}
tr.output-row > td { background: var(--surface-2); white-space: normal; }
.payload-preview { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.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; }

.copy-row { display: flex; gap: 8px; align-items: stretch; }
.copy-row input, .copy-row pre { flex: 1; }
.copy-row input { font-family: var(--mono); direction: ltr; }
.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, #041513 0%, #0A3B36 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
   ============================================================================================ */
.room-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.room-title .eyebrow { font-size: 12px; font-weight: 600; color: var(--primary); letter-spacing: .04em; margin-bottom: 2px; }
.room-title h1 { font-size: 24px; }
.room-title .sub { color: var(--muted); margin-top: 3px; font-size: 13.5px; }

.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.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-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.stat-icon svg.icon { width: 18px; height: 18px; }
.stat-text { display: flex; flex-direction: column; line-height: 1.15; }
.stat-value { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.stat.total { --accent: var(--primary); --accent-soft: var(--primary-soft); }
.stat.online { --accent: var(--success); --accent-soft: var(--success-soft); }
.stat.online .stat-value { color: var(--success); }
.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; }

/* ============================================================================================
   Responsive
   ============================================================================================ */
@media (max-width: 1400px) {
  .stat { min-width: 0; padding: 8px 12px; }
  .stat-icon { width: 30px; height: 30px; }
}
/* 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; }
  .stats { width: 100%; }
}

/* ============================================================================================
   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, #1C2E2C 0%, #33474A 100%);
  --viewer-bg: #071513;
  --viewer-head: #0C1F1D;
  --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: #030A09;
  --viewer-head: #081715;
}
.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 */
.device-screen-body { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.tile-screen.device-shot { width: min(480px, 100%); flex: none; cursor: zoom-in; }
.device-screen-side { flex: 1 1 220px; display: grid; gap: 12px; }
.device-screen-side p { margin: 0; }

/* full viewer (NetSupport "View" / Veyon "Watch") */
body.viewer-open { overflow: hidden; }
.viewer-backdrop {
  position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 2vh 2vw;
  background: rgba(3, 6, 14, .78); animation: fade .12s ease-out;
}
.viewer {
  position: relative; touch-action: manipulation;
  width: 92vw; height: 92vh; display: flex; flex-direction: column; overflow: hidden;
  background: var(--viewer-bg); color: #e2e8f0; border: 1px solid var(--viewer-border); border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .6); animation: pop .12s ease-out;
}
.viewer-head {
  display: flex; align-items: center; gap: 14px; padding: 9px 12px 9px 14px;
  background: var(--viewer-head); border-bottom: 1px solid var(--viewer-border);
}
.viewer-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.viewer-badge {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: linear-gradient(140deg, #0F9186, #065A53); color: #fff;
}
.viewer-badge svg.icon { width: 18px; height: 18px; }
.viewer-names { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.viewer-name { font-weight: 700; font-size: 15.5px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-sub { font-size: 12.5px; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-meta { display: flex; align-items: center; gap: 8px; }
.viewer-pill {
  font-size: 12px; font-variant-numeric: tabular-nums; padding: 2px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); color: #cbd5e1; 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; gap: 4px; }
.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; }
.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; }
.viewer-foot {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px; font-size: 12px; color: #64748b;
  border-top: 1px solid var(--viewer-border); background: var(--viewer-head);
}
.viewer-foot svg.icon { width: 14px; height: 14px; }
.viewer-foot-text { display: flex; align-items: center; gap: 6px; }
.viewer-foot-text svg.icon { flex: none; }

/* remote control (NetSupport "Control"): mode switch, key toolbar, clipboard, files dropped on the screen */
.viewer:focus { outline: none; }
.viewer.controlling { border-color: rgba(245, 158, 11, .65); box-shadow: 0 0 0 2px rgba(245, 158, 11, .35), 0 24px 80px rgba(0, 0, 0, .6); }
.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: #0B766E; 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-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: #0B766E; border-color: #14B8A6; color: #fff; font-weight: 600; }
.viewer-btn.primary:hover { background: #0A6A63; }
.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: #14B8A6; 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: #0B766E; }
.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 { 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 {
  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-foot, .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-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 ---- */
.classroom-group { flex-wrap: wrap; }
.room-select { min-width: 150px; font-weight: 600; }
.badge.dark { background: #082522; color: #DCEBE8; }
.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 */
.ver-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ver-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-border); font-size: 13px;
}
.ver-chip svg.icon { width: 15px; height: 15px; }
.ver-chip strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.ver-err { cursor: help; }

/* ============================================================================================
   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 ---- */
.page-head { align-items: flex-end; margin-bottom: var(--space-5); row-gap: var(--space-3); }
.page-head h1, .room-title h1 { font-size: var(--fs-2xl); line-height: 1.25; }
.page-head .sub { font-size: var(--fs-sm); }
.page-head > .actions, .page-head > div:last-child:not(:first-child) { flex-wrap: wrap; }
.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, .details-grid + .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); }
.details-grid { gap: var(--space-4); }
.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); }

/* ---- login ---- */
.login-page { background: radial-gradient(1200px 600px at 80% -10%, #0F9186 0%, transparent 60%), linear-gradient(160deg, #041513 0%, #0A3B36 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 ---- */
.room-head { margin-bottom: var(--space-4); }
.stats { gap: var(--space-2); }
.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) {
  .room-head { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: var(--space-3); }
  .stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .stat { min-width: 0; }
}
@media (max-width: 900px) and (min-width: 561px) {
  .stat-icon { display: none; }
  .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; }
  .page-head { align-items: stretch; flex-direction: column; }
  .page-head > * { min-width: 0; }
  .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) 1fr; gap: 6px 12px; }
  .details-grid { grid-template-columns: minmax(0, 1fr); }
  .toast-host { inset-inline: 12px; bottom: 12px; }
  .toast { max-width: none; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .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; }
  .page-head .actions .btn, .page-head > div > .btn { flex: 1 1 auto; }
}
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; }
.toolbar-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.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; }
.vault-filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 0 10px; }
.vault-filters input, .vault-filters select { flex: 1 1 200px; }
.vault-group { border: 1px solid var(--border); border-radius: 10px; margin-top: 8px; overflow: hidden; }
.vault-group > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; cursor: pointer;
  list-style: none; font-weight: 600; background: var(--surface-2, transparent); }
.vault-group > summary::-webkit-details-marker { display: none; }
.vault-group > summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted); transform: rotate(135deg); transition: transform .15s; flex: none; margin-inline: 2px 4px; }
.vault-group[open] > summary::before { transform: rotate(45deg); }
.vault-group > summary .muted { font-weight: 400; }
.vault-group .table-wrap { border-top: 1px solid var(--border); }
.vault-group td.nowrap, .vault-group td .btn { white-space: nowrap; }
.vault-group td.vault-product { white-space: normal; min-width: 180px; }
.vault-group td.vault-product .ltr { unicode-bidi: plaintext; text-align: start; }
.vault-group .small { font-size: 12px; }
.nowrap { white-space: nowrap; }

/* license vault table (0.8.3): one aligned row per key */
.vault-group > summary .vault-org { margin-inline-start: auto; font-weight: 400; font-size: 12.5px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; background: var(--surface); }
table.vault-table { table-layout: fixed; min-width: 900px; }
table.vault-table th:nth-child(1) { width: auto; }
table.vault-table th:nth-child(2) { width: 120px; }
table.vault-table th:nth-child(3) { width: 210px; }
table.vault-table th:nth-child(4) { width: 110px; }
table.vault-table.with-used th:nth-child(5) { width: 140px; }
table.vault-table th.vault-actions { width: 170px; }
table.vault-table td { vertical-align: middle; }
table.vault-table td.vault-products { white-space: normal; }
.vault-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vault-chip { display: inline-block; padding: 3px 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; line-height: 1.4; }
.vault-key { display: inline-block; letter-spacing: .04em; }
.vault-meter { display: grid; gap: 5px; max-width: 190px; }
.vault-meter-text { font-size: 13px; }
.vault-bar { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.vault-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--success); }
.vault-bar.low > span { background: #d97706; }
.vault-bar.none { background: var(--danger); opacity: .35; }
table.vault-table th.vault-actions, table.vault-table td.vault-actions { text-align: end; }
.vault-actions-row { display: inline-flex; gap: 4px; justify-content: flex-end; }
.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 */
.lic-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; overflow: hidden; }
.lic-stat { display: grid; gap: 8px; padding: 18px 22px; text-align: start; font: inherit; color: inherit; align-content: start;
  background: transparent; border: 0; border-inline-start: 1px solid var(--border); border-radius: 0; min-width: 0; }
.lic-stat:first-child { border-inline-start: 0; }
button.lic-stat { cursor: pointer; }
button.lic-stat:hover { background: var(--hover); }
button.lic-stat:focus-visible { outline: none; box-shadow: inset var(--ring); }
.lic-stat-title { font-size: 13px; color: var(--muted); font-weight: 500; }
.lic-stat-value { font-variant-numeric: tabular-nums; }
.lic-stat-value strong { font-size: 26px; font-weight: 650; line-height: 1.1; }
.vault-meter-text, .lic-cat-count { font-variant-numeric: tabular-nums; }
.lic-stat-value .muted { font-size: 14px; }
.lic-stat-hint { font-size: 12.5px; color: var(--muted); }
.lic-stat-hint.warn { color: var(--warning-text, var(--warning)); }
.lic-stat .vault-bar.ok > span { background: var(--success); }
.lic-card[hidden] { display: none; }
.lic-bar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.lic-bar-title { display: flex; align-items: baseline; gap: 10px; flex: none; }
.lic-bar-title h2 { margin: 0; font-size: var(--fs-lg); }
.lic-bar-title .muted { font-size: 13px; white-space: nowrap; }
.lic-bar-filters { display: flex; align-items: center; gap: 8px; flex: 1 1 320px; min-width: 0; flex-wrap: wrap; }
.lic-bar-filters input[type=search] { flex: 1 1 180px; max-width: 300px; min-width: 140px; }
.lic-bar-filters select, .lic-bar-filters .dd { flex: 0 1 auto; width: auto; }
.lic-bar-actions { display: flex; gap: 8px; flex: none; margin-inline-start: auto; flex-wrap: wrap; }
.lic-bar-actions .btn { white-space: nowrap; }
.lic-cats { display: flex; gap: 6px; padding: 10px 20px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.lic-cats:empty { display: none; }
.lic-cat { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; flex: none; }
.lic-cat:hover { background: var(--hover); }
.lic-cat.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.lic-cat-count { font-size: 12px; padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 500; }
.lic-cat.active .lic-cat-count { background: var(--surface); color: var(--primary); }
.lic-foot { padding: 10px 20px; font-size: 12.5px; border-top: 1px solid var(--border); }
.lic-card .table-wrap { border: 0; }
.lic-card table.grid th:first-child, .lic-card table.grid td:first-child { padding-inline-start: 20px; }
.lic-card table.grid th:last-child, .lic-card table.grid td:last-child { padding-inline-end: 20px; }
.lic-card table.grid tbody tr:last-child td { border-bottom: 0; }
.lic-pc { display: flex; align-items: center; gap: 10px; }
.lic-pc a { font-weight: 600; }
.lic-cell { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lic-edition { font-weight: 500; }
.lic-table .small, .vault-table .small { font-size: 12px; }
@media (max-width: 1100px) { .lic-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lic-stat:nth-child(3) { border-inline-start: 0; } .lic-stat:nth-child(n+3) { border-top: 1px solid var(--border); } }
@media (max-width: 560px) {
  .lic-stat { padding: 14px 16px; } .lic-stat-value strong { font-size: 22px; }
  .lic-bar { padding: 12px 14px; }
  .lic-bar-filters, .lic-bar-actions { flex: 1 1 100%; }
  .lic-bar-filters input[type=search] { max-width: none; }
  .lic-bar-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ============================================================================================
   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; }
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-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 380px); gap: var(--space-6) 40px; align-items: center; padding: 32px; border-radius: 24px; box-shadow: var(--shadow-lg);
  --hero-fg: #fff;
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--primary) 78%, var(--primary) 100%); color: var(--hero-fg); }
:root[data-theme=dark] .dev2-hero { --hero-fg: var(--text); background: linear-gradient(135deg, var(--surface-2) 0%, color-mix(in srgb, var(--primary) 38%, var(--surface)) 110%); }
:root[data-theme=dark] .dev2-hero .dev-actions > .btn.primary { background: var(--primary); color: var(--on-primary); }
.dev2-hero-main { display: grid; gap: var(--space-5); min-width: 0; }
.dev2-hero .dev-hero-title h1 { font-size: 36px; font-weight: 700; letter-spacing: -.02em; color: inherit; }
.dev2-hero .dev-state, .dev2-hero .dev-state.on { height: 30px; padding: 0 14px; background: color-mix(in srgb, #000 22%, transparent); color: var(--hero-fg); }
.dev2-hero .dev-facts { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.dev2-hero .dev-fact { gap: 8px; padding: 7px 14px; border-radius: 999px; background: color-mix(in srgb, #000 20%, transparent); }
.dev2-hero .dev-fact > svg.icon { width: 15px; height: 15px; color: inherit; opacity: .9; }
.dev2-hero .dev-fact-text { display: flex; gap: 6px; align-items: baseline; }
.dev2-hero .dev-fact-label { color: inherit; opacity: .92; }
.dev2-hero .dev-fact-value { font-weight: 600; }
.dev2-hero .dev-fact a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.dev2-hero .dev-actions { border-top: 0; padding-top: 0; gap: 8px; }
.dev2-hero .dev-actions .dd-chev { color: inherit; opacity: 1; }
.dev2 .dev2-hero .dev-actions .btn:not(.primary):not(.danger):not(.ghost) { background: color-mix(in srgb, var(--hero-fg) 16%, transparent); border-color: color-mix(in srgb, var(--hero-fg) 30%, transparent); color: var(--hero-fg); }
.dev2-hero .dev-actions > .btn, .dev2-hero .dev-actions > .dd > .btn { height: 42px; padding: 0 14px; border-radius: 12px; font-weight: 600; border-color: transparent; background: color-mix(in srgb, var(--hero-fg) 14%, transparent); color: inherit; }
.dev2 .dev2-hero .dev-actions .btn:not(.primary):not(.danger):not(.ghost):hover:not(:disabled) { border-color: color-mix(in srgb, var(--hero-fg) 45%, transparent); background: color-mix(in srgb, var(--hero-fg) 24%, transparent); }
.dev2-hero .dev-actions > .btn svg.icon, .dev2-hero .dev-actions > .dd > .btn svg.icon { color: inherit; }
.dev2-hero .dev-actions > .btn.primary { background: var(--hero-fg); color: var(--primary-soft-text); }
.dev2-hero .dev-actions > .btn.primary:hover:not(:disabled) { background: var(--primary-soft); }
.dev2-hero .dev-actions > .btn:disabled { opacity: .6; }
.dev2-hero .dd-menu { color: var(--text); }
.dev2-hero-screen { display: grid; gap: 8px; min-width: 0; }
.dev2-hero .device-shot { border-radius: 14px; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.dev2-hero .dev-shot-info { color: inherit; opacity: .92; }
.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-hero { grid-template-columns: minmax(0, 1fr); padding: 20px; border-radius: 20px; }
  .dev2-hero-screen { order: -1; }
  .dev2-hero .dev-hero-title h1 { font-size: 26px; }
  .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); }
  .dev2-tabs { display: flex; justify-self: stretch; }
  .dev2-tabs .seg-btn { flex: 1 1 0; padding: 0 6px; justify-content: center; }
  .dev2 .dev-row > summary { padding: 14px 16px; }
}

/* rooms page */
.room-new { flex: 0 1 420px; min-width: min(100%, 280px); }
.room-new .fav-save { flex-wrap: nowrap; }
.room-new .error-text:empty { display: none; }
.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; }
.room-card-name { flex: 1; min-width: 0; font-size: var(--fs-xl); font-weight: 650; color: var(--text); overflow-wrap: anywhere; line-height: 1.25; }
.room-card-name:hover { color: var(--link); text-decoration: none; }
.room-card-empty { font-size: var(--fs-sm); line-height: 1.5; flex: 1; }
@media (max-width: 760px) { .room-new { flex: 1 1 auto; } }

/* rooms page: one section per room with its live screens */
.room-live.no-room .room-card-icon, .room-live.is-empty .room-card-icon { background: var(--badge-bg); color: var(--muted); }
.room-live-list { display: grid; gap: var(--space-4); }
.room-live-list > .card + .card { margin-top: 0; }
.room-live { padding: var(--space-4) var(--space-5); display: grid; gap: var(--space-4); }
.room-live-head { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.room-live-title { flex: 1; display: grid; min-width: 0; line-height: 1.35; }
.room-live-title .muted { font-size: var(--fs-sm); }
.room-live-screens { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--space-3); }
.room-live-pc { display: grid; gap: 5px; color: var(--text); min-width: 0; }
.room-live-pc:hover { text-decoration: none; color: var(--link); }
.room-live-pc .tile-screen { display: block; width: 100%; border-radius: var(--radius-sm); }
.room-live-pc .tile-screen:not(.live) > img { display: none; }
.room-live-pc .tile-screen.live > .screen-ph { display: none; }
.room-live-name { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 600; min-width: 0; }
.room-live-name .ltr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-live-name .dot { width: 7px; height: 7px; flex: none; }
.room-live-more { display: grid; place-items: center; border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--muted); font-size: var(--fs-sm); min-height: 70px; }
@media (max-width: 900px) {
  .room-live-head { flex-wrap: wrap; }
  .room-live-screens { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--space-2); }
}

/* ---- one summary strip everywhere (classroom figures, disk protection, power, updates) ---- */
.stats, .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); }
.stat-label { white-space: normal; }
.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; }
.room-head { align-items: center; }
.room-head .stats { flex: 0 1 760px; }
@media (max-width: 1400px) { .stats { grid-template-columns: repeat(5, minmax(0, 1fr)); } .room-head .stats { flex: none; } }
@media (max-width: 760px) {
  .stats, .tiles { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
  .stat { padding: 8px 10px; gap: 8px; }
  .stat-icon { display: none; }
  .tiles > .card.tile { padding: 10px var(--space-3); min-height: 60px; border-bottom: 1px solid var(--border); margin-bottom: -1px; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .stats .stat:last-child:nth-child(odd) { grid-column: auto; }
  .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; }
  .stat-text { align-items: center; min-width: 0; max-width: 100%; }
  .stat-value { font-size: var(--fs-xl); }
  .stat-label { font-size: 11px; line-height: 1.25; }
}

/* ---- shared fixes from the screen-by-screen review ---- */
/* table toolbars: title at the start, filters grouped at the end */
.card-head.toolbar-row { justify-content: flex-start; }
.card-head.toolbar-row > h2 { margin-inline-end: auto; }
/* 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: 1180px) {
  /* phone menu: the user row (password, theme, sign out) is always reachable */
  .side-foot { position: sticky; bottom: 0; background: var(--sidebar-bg-2); }
}
@media (max-width: 760px) {
  .modal-foot { padding-inline: var(--space-4); }
}
@media (max-width: 560px) {
  .copy-row { flex-direction: column; }
  .copy-row .btn { align-self: flex-start; }
  .copy-row input { width: 100%; }
}

/* ---- 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 > .lic-cell { justify-content: flex-end; }
  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; }
.upd-version { flex: 0 1 180px; }
.upd-version input { width: 100%; }
.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 */
.page-tabs { margin-bottom: var(--space-4); max-width: 100%; }
.page-tabs .seg-btn { height: 32px; padding: 0 16px; font-size: var(--fs-md); }
/* updates */
.upd-system { display: grid; gap: var(--space-4); }
.upd-system .tiles { margin: 0; box-shadow: none; }
.upd-system .warn-box { font-size: var(--fs-sm); }
.upd-note { font-size: var(--fs-xs); margin-top: 4px; overflow-wrap: anywhere; }
.upd-hint { font-size: var(--fs-xs); }
.upd-tab { display: grid; gap: var(--space-4); }
.upd-tab > div:empty { display: none; }
.upd-tab > .card + .card { margin-top: 0; }
.upd-none { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.card-body > .tiles { box-shadow: none; }
/* add computers */
.enroll-warn { margin-bottom: var(--space-4); }
.enroll-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: var(--space-4); align-items: start; margin-bottom: var(--space-4); }
.enroll-grid .card + .card { margin-top: 0; }
.enroll-side { display: grid; gap: var(--space-4); }
.enroll-main .card-body, .enroll-side .card-body, .enroll-manual .card-body { display: grid; gap: var(--space-4); }
.steps > li::marker { font-weight: 700; color: var(--primary); }
.step-action { margin-top: var(--space-2); }
.nowrap { white-space: nowrap; }
.copy-value { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--input-bg); overflow-wrap: anywhere; font-size: var(--fs-sm); line-height: 1.5; text-align: left; }
.copy-value:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--primary); }
.copy-row pre { min-width: 0; }
details.enroll-manual > summary { cursor: pointer; list-style: none; border-bottom: 0; }
details.enroll-manual > summary::-webkit-details-marker { display: none; }
details.enroll-manual > summary::after { content: ""; width: 8px; height: 8px; border-inline-end: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-inline-start: auto; transition: transform .15s; }
details.enroll-manual > summary > .muted { font-size: var(--fs-sm); }
details.enroll-manual[open] > summary { border-bottom: 1px solid var(--border); }
details.enroll-manual[open] > summary::after { transform: rotate(225deg); }
details.enroll-manual > summary:focus-visible { outline: none; box-shadow: inset var(--ring); border-radius: var(--radius-lg); }
@media (max-width: 1000px) { .enroll-grid { grid-template-columns: minmax(0, 1fr); } }

/* ============================================================================================
   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; }
.page-head { margin-bottom: var(--space-6); }
.page-head h1, .room-title h1 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.page-head .sub { font-size: var(--fs-md); margin-top: 6px; }
.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, .details-grid + .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 */
.stats, .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; }
.stat-icon { width: 44px; height: 44px; border-radius: 14px; }
.stat-icon svg.icon { width: 21px; height: 21px; }
.stat-value, .tile .value { font-size: 24px; font-weight: 700; }
.stat-label, .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, .stat.online .stat-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; }
.room-head .stats { flex: 0 1 900px; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-3); }
.room-head .stat { padding: 12px 14px; gap: 10px; }
.room-head .stat-icon { width: 38px; height: 38px; border-radius: 12px; }
@media (max-width: 1400px) { .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } .room-head .stats { flex: none; grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .main { padding: 18px 14px 40px; }
  .page-head h1, .room-title h1 { font-size: 24px; }
  .stats, .tiles, .room-head .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
  .stat, .tiles > .card.tile { padding: 12px 14px; }
  .stat-icon { width: 36px; height: 36px; border-radius: 11px; }
  .stat-value, .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 .small code, .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); }
.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-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.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-room { color: var(--muted); font-weight: 400; font-size: var(--fs-sm); margin-inline-start: 10px; }
.hl-sub { color: var(--muted); font-size: var(--fs-md); overflow-wrap: anywhere; }
.hl-also { white-space: nowrap; }
.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); }
.hl-allgood { display: grid; justify-items: center; gap: 6px; padding: 44px 24px; text-align: center; }
.hl-allgood .hl-ic { margin-bottom: 8px; }
.hl-under { padding: 12px 6px 0; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-align: start; }
.linklike:hover { text-decoration: underline; }
.hl-sched-link { color: var(--muted); font-size: var(--fs-sm); }
.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-job-line { font-weight: 600; color: var(--primary); }
.hl-job-line, .hl-job-facts-line, .hl-job-detail { display: block; overflow-wrap: anywhere; }
.hl-head.hl-head-sub { border-top: 1px solid var(--border); }
.hl-head-sub .hl-head-title { font-size: var(--fs-lg); }
.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-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.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; }

/* Backup tab (system updates page) */
.bk-advice ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; }
/* Reports page */
/* Chart status colours: stepped apart from the UI tokens so red / amber / green stay distinct for colour-blind readers
   (checked with the dataviz palette validator on both surfaces). Greys = no health data that day. */
:root { --rp-bad: #B91C1C; --rp-warn: #E0A106; --rp-ok: #15803D; --rp-off: #B8C4C2; --rp-unknown: #7C8B89; }
:root[data-theme=dark] { --rp-bad: #C93434; --rp-warn: #C4921C; --rp-ok: #15803D; --rp-off: #3D4B49; --rp-unknown: #6F807D; }
.rp-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.rp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 12px; font-size: 13px; }
.rp-key { display: inline-flex; align-items: center; gap: 6px; }
.rp-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.rp-area { display: flex; gap: 8px; height: 240px; }
.rp-y { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 22px; font-size: 12px; color: var(--muted); text-align: end; min-width: 24px; font-variant-numeric: tabular-nums; }
.rp-plot-wrap { position: relative; flex: 1; min-width: 0; }
.rp-grid { position: absolute; inset: 0 0 22px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.rp-grid i { border-top: 1px solid var(--border); }
.rp-plot { position: absolute; inset: 0; display: flex; align-items: stretch; justify-content: space-between; gap: 2px; }
.rp-col { flex: 1 1 0; max-width: 28px; min-width: 2px; display: flex; flex-direction: column; justify-content: flex-end; outline: none; }
.rp-stack { display: flex; flex-direction: column-reverse; gap: 2px; min-height: 2px; border-radius: 4px 4px 0 0; overflow: hidden; }
.rp-col:hover .rp-stack, .rp-col:focus-visible .rp-stack { filter: brightness(1.12); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border-strong); }
.rp-seg { min-height: 2px; }
.rp-x { height: 22px; line-height: 22px; font-size: 11px; color: var(--muted); text-align: center; white-space: nowrap; overflow: visible; font-variant-numeric: tabular-nums; }
.rp-tip { position: absolute; top: 0; z-index: 2; direction: rtl; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; font-size: 13px; box-shadow: 0 6px 20px rgb(0 0 0 / .14); pointer-events: none; min-width: 170px; }
.rp-tip-title { font-weight: 600; margin-bottom: 4px; }
.rp-tip-row { display: flex; align-items: center; gap: 6px; }
.rp-tip-row strong { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.rp-note { margin-top: 10px; }
.rp-bad { margin-inline-start: 8px; }
.rp-exports { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.rp-export { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none; }
.rp-export:hover { background: var(--hover); border-color: var(--border-strong); }

/* 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); }
