/*
 * VMTabs - virtual labs for schools
 * Copyright (c) 2026 VMTabs. All rights reserved.
 * Proprietary and confidential. Copying, distributing or modifying this file without written
 * permission is prohibited. See COPYRIGHT for third-party components and their licenses.
 * SPDX-License-Identifier: LicenseRef-VMTabs-Proprietary
 */
:root {
  --bg: #eef1f7;
  --panel: #ffffff;
  --ink: #16203a;
  --muted: #5a647c;
  --line: #dbe0ea;
  --rail: #1b2247;
  --rail-ink: #c3c9e0;
  --accent: #ee5a12;
  --accent-ink: #ffffff;
  --ok: #138a4c;
  --led: #1fb86a;
  --warn: #b7791f;
  --bad: #d0312d;
  --focus: #3b6fe0;
  --radius: 10px;
  --shadow: 0 1px 2px #16203a0f, 0 4px 14px #16203a0a;
  --display: "Poppins", var(--sans);
  --banner: #1b2247;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
/* dark: follows the device unless the user picked Light or Dark in Settings */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1222; --panel: #151b30; --ink: #e6e9f4; --muted: #98a1bb; --line: #263051;
    --rail: #0a0e1d; --rail-ink: #aab2cf; --accent: #ff7a2e; --ok: #4fd18b; --led: #39e08a; --warn: #fcc419; --bad: #ff6b6b;
    --shadow: 0 1px 2px #0006; --banner: #1d2658;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1222; --panel: #151b30; --ink: #e6e9f4; --muted: #98a1bb; --line: #263051;
  --rail: #0a0e1d; --rail-ink: #aab2cf; --accent: #ff7a2e; --ok: #4fd18b; --led: #39e08a; --warn: #fcc419; --bad: #ff6b6b;
  --shadow: 0 1px 2px #0006; --banner: #1d2658;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.dev-banner { background: #f59f00; color: #1a1300; text-align: center; font-size: 13px; font-weight: 600; padding: 5px 12px; }
.dev-banner + .shell { min-height: calc(100vh - 28px); }
[hidden], .hidden { display: none !important; }
#nav { display: flex; flex-direction: column; gap: 2px; }
.help { color: var(--muted); font-size: 12px; margin-top: 2px; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
select.compact { width: auto; padding: 4px 8px; font-size: 13px; }
.small { font-size: 12px; }
.preview-banner { background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: var(--radius); margin-bottom: 16px; }
.project + .project, .project + h2 { margin-top: 26px; }
th button.sort { all: unset; cursor: pointer; white-space: nowrap; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
th button.sort:hover { color: var(--ink); }
th button.sort:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sort-mark { font-size: 10px; opacity: .7; }
a.course-link { color: var(--ink); font-weight: 700; text-decoration: none; border-bottom: 1px solid var(--line); }
a.course-link:hover { color: var(--accent); border-color: var(--accent); }
a.btn { text-decoration: none; display: inline-block; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 8px; }
.fact { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.fact-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.fact-value { font-size: 26px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.section-head { margin: 26px 0 10px; }
.section-head h2 { margin: 0; }
.btn.sm { font-size: 12px; padding: 3px 8px; border-radius: 5px; }
.btn-row.tight { gap: 4px; max-width: 330px; }
.host-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.panel.host { padding: 16px 18px; }
.panel.host h2 { margin: 0 0 4px; font-size: 16px; }
.host-meta { margin-bottom: 10px; }
.meter { margin-top: 12px; }
.meter-label { font-size: 13px; font-weight: 600; }
.meter-value { font-size: 13px; font-variant-numeric: tabular-nums; }
.meter-flag { margin-left: 6px; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 10px; border: 1px solid currentColor; }
.meter-flag.warn { color: var(--warn); }
.meter-flag.crit { color: var(--bad); }
.meter-track { height: 8px; border-radius: 4px; background: var(--line); margin: 4px 0 3px; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 4px; background: var(--focus); }
.meter-fill.warn { background: var(--warn); }
.meter-fill.crit { background: var(--bad); }
.panel.notice { padding: 14px 16px; margin-bottom: 14px; border-left: 4px solid var(--warn); }
.panel.notice pre { white-space: pre-wrap; background: var(--bg); padding: 8px 10px; border-radius: 6px; margin: 8px 0; font-size: 12px; }
/* discreet Student view switch, top-right of the content area */
.topbar { display: flex; justify-content: flex-end; margin: -14px 0 6px; min-height: 24px; }
.topbar { gap: 4px; align-items: center; }
dl.kv.compact { grid-template-columns: 1fr max-content; margin-top: 12px; gap: 8px 12px; }
dl.kv.compact dd { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.search-row { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
input.search { max-width: 360px; padding: 7px 12px; }
.crumb-line { margin-bottom: 4px; }
.crumb { display: inline-block; font-size: 13px; color: var(--muted); text-decoration: none; margin-bottom: 4px; }
.crumb:hover { color: var(--ink); }
.link-btn { all: unset; cursor: pointer; font-size: 12px; color: var(--accent); font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.link-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.danger-zone { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); }
.project-list { display: grid; gap: 6px; margin: 10px 0 6px; max-height: 280px; overflow: auto; }
.project-row { padding: 6px 0; border-bottom: 1px solid var(--line); }
a.btn.sm { font-size: 12px; padding: 3px 8px; }
.upload-progress { margin-top: 14px; }
.upload-progress .meter-track { height: 10px; }
/* top-right account menu */
.topbar { gap: 10px; }
.account { position: relative; }
.account-btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted);
  padding: 4px 10px; border-radius: 999px; border: 1px solid transparent; }
.account-btn:hover, .account-btn[aria-expanded="true"] { color: var(--ink); border-color: var(--line); background: var(--panel); }
.account-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.avatar { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--rail); color: #fff; }
.caret { font-size: 10px; opacity: .7; }
.account-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 220px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px #0002; padding: 6px; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-item { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; padding: 8px 10px; border-radius: 6px; font-size: 14px; color: var(--ink); }
.menu-item:hover, .menu-item:focus-visible { background: var(--bg); }
.menu-item.checked::after { content: "  ✓"; color: var(--accent); font-weight: 700; }
.menu-item.danger { color: var(--bad); }
.menu-sep { height: 1px; background: var(--line); margin: 4px 0; }
.menu-foot { padding: 6px 10px 2px; }
@media (max-width: 700px) { .account-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
/* names that open an edit dialog */
.name-link { all: unset; cursor: pointer; font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--line); }
.name-link.plain { font-weight: 400; border-bottom-color: transparent; }
.name-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.name-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.expiry-line { margin: -4px 0 10px; font-size: 13px; }
.expiry-line.soon { color: var(--warn); }
.expiry-line.soon strong { color: var(--warn); }
.warn-text { color: var(--warn); }
.expiry-note { font-size: 12px; margin: 8px 0 2px; padding: 6px 8px; border-radius: 6px; background: var(--bg); color: var(--muted); }
.expiry-note.soon { color: var(--warn); border: 1px solid var(--warn); background: transparent; font-weight: 600; }
.view-toggle { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted);
  padding: 3px 9px; border: 1px solid transparent; border-radius: 999px; }
.view-toggle:hover { color: var(--ink); border-color: var(--line); }
.view-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.view-toggle.on { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.view-toggle .eye { width: 14px; height: 9px; border: 1.5px solid currentColor; border-radius: 50%; position: relative; }
.view-toggle .eye::after { content: ""; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: currentColor; left: 50%; top: 50%; transform: translate(-50%, -50%); }
/* tabs: Templates | Build VMs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 14px; }
.tab { padding: 8px 14px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--accent); }
/* settings */
.settings-stack { display: grid; gap: 14px; max-width: 860px; }
.settings-card { padding: 18px 20px; }
.settings-card h2 { margin: 0 0 4px; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 18px; }
.setting label { margin-top: 10px; }
.setting-value { padding: 8px 0; }
.settings-card .actions { margin-top: 14px; display: flex; justify-content: flex-end; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 10px 0 0; font-size: 13px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.mono { font-family: var(--mono); font-size: 0.9em; }
.muted { color: var(--muted); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--rail); color: var(--rail-ink); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; letter-spacing: .02em; margin: 0 6px 22px; }
a.brand { text-decoration: none; border-radius: 8px; }
a.brand:hover .brand-word { color: #fff; opacity: .9; }
a.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.brand-mark { width: 28px; height: 28px; flex: none; display: block; }
.brand-mark .bm-bg { fill: var(--accent); }
.brand-mark .bm-ink { stroke: var(--accent-ink); }
.brand-mark .bm-dim { stroke-opacity: .55; }
.brand-word { font-size: 17px; letter-spacing: .01em; }
a.muted-link { color: var(--muted); text-decoration: none; }
a.muted-link:hover { color: var(--accent); text-decoration: underline; }
.nav-btn { all: unset; cursor: pointer; padding: 8px 12px; border-radius: 6px; color: var(--rail-ink); }
.nav-btn:hover { background: #ffffff10; color: #fff; }
.nav-btn[aria-current="page"] { background: #ffffff18; color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
main { padding: 28px 36px 60px; max-width: 1200px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
h1 { font-size: 24px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 28px 0 10px; }
.lede { color: var(--muted); margin: 4px 0 0; }

/* ---------- controls ---------- */
.btn { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 6px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: #ffffff30; color: var(--rail-ink); }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
input, select, textarea { font: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--ink); }
textarea { min-height: 120px; font-family: var(--mono); font-size: 13px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.check input { width: auto; }

/* ---------- tables & cards ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.card h3 { margin: 0; font-size: 16px; word-break: break-all; }
.card .meta { font-size: 13px; color: var(--muted); }
.card .btn-row { margin-top: auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); text-transform: capitalize; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill.running::before, .pill.ready::before, .pill.online::before { background: var(--ok); }
.pill.provisioning::before, .pill.deleting::before { background: var(--warn); animation: pulse 1.2s infinite; }
.pill.error::before { background: var(--bad); }
@keyframes pulse { 50% { opacity: .25; } }
.err-text { color: var(--bad); font-size: 13px; }

/* ---------- dialogs / toasts ---------- */
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 0; width: min(560px, 92vw); background: var(--panel); color: var(--ink); }
dialog::backdrop { background: #0008; }
dialog form { padding: 22px 24px; }
dialog h2 { margin: 0 0 6px; }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.secret { font-family: var(--mono); background: var(--bg); border: 1px dashed var(--line); padding: 10px; border-radius: 6px; white-space: pre-wrap; user-select: all; }
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--rail); color: #fff; padding: 10px 14px; border-radius: 8px; max-width: 380px; font-size: 14px; box-shadow: 0 6px 24px #0004; }
.toast.bad { background: var(--bad); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(circle at 20% 10%, #d9480f22, transparent 40%), var(--bg); }
.login { width: min(380px, 100%); padding: 32px; }
.login .brand { color: var(--ink); margin: 0 0 20px; }
.login .btn { width: 100%; margin-top: 18px; padding: 10px; }

/* ---------- console ---------- */
body.console { background-color: #000; overflow: hidden; margin: 0; }
/* Slim icon rail on the left edge: dim until you point at it, so the VM gets the whole screen. */
.console-rail { position: fixed; top: 0; left: 0; bottom: 0; width: 40px; z-index: 6; display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 10px 0; background-color: #0d1014e6; border-right: 1px solid #ffffff10; transition: transform .2s ease, opacity .2s ease; }
.rail-btn { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; cursor: pointer;
  background: transparent; color: #8b94a3; opacity: .7; transition: opacity .15s ease, background-color .15s ease, color .15s ease; }
.console-rail:hover .rail-btn, .rail-btn:focus-visible { opacity: 1; }
.rail-btn:hover:not(:disabled), .rail-btn[aria-expanded="true"] { background-color: #ffffff14; color: #fff; }
.rail-btn:disabled { opacity: .25; cursor: default; }
.rail-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.rail-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#start, #reconnect { color: #ff9a5c; opacity: 1; }
.rail-btn .fs-out, body.fs .rail-btn .fs-in { display: none; }
body.fs .rail-btn .fs-out { display: inline; }
.rail-led { width: 8px; height: 8px; border-radius: 50%; margin: 2px 0 10px; background-color: #5c6370; flex: none; }
.rail-led.on { background-color: var(--led, #1fb86a); box-shadow: 0 0 6px #1fb86a99; }
.rail-led.wait { background-color: #e0a526; animation: rail-blink 1s ease-in-out infinite; }
.rail-led.off { background-color: #d0312d; }
@keyframes rail-blink { 50% { opacity: .35; } }
.rail-wrap { position: relative; }
.rail-menu { position: absolute; left: 38px; top: -6px; width: 250px; display: flex; flex-direction: column; padding: 6px; border-radius: 10px;
  background-color: #171b21; border: 1px solid #ffffff1a; box-shadow: 0 8px 24px #0009; }
.rail-menu[hidden] { display: none; }
.rail-menu-head { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #8b94a3; padding: 4px 8px 6px; }
.rail-item { display: grid; gap: 1px; text-align: left; padding: 7px 8px 7px 26px; border: 0; border-radius: 7px; background: transparent; color: #e6e9ef;
  font: inherit; font-size: 13px; cursor: pointer; position: relative; }
.rail-item span { color: #8b94a3; font-size: 12px; }
.rail-item:hover, .rail-item:focus-visible { background-color: #ffffff12; outline: none; }
.rail-item[aria-checked="true"]::before { content: ""; position: absolute; left: 10px; top: 13px; width: 7px; height: 7px; border-radius: 50%;
  background-color: var(--accent); }
/* The VM's name: a small label next to the rail, shown on open and while pointing at the controls. */
.console-name { position: fixed; top: 10px; left: 50px; z-index: 6; padding: 4px 10px; border-radius: 6px; font-size: 13px; font-weight: 600;
  color: #fff; background-color: #0d1014d9; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.console-name.show { opacity: 1; }
#screen { position: absolute; top: 0; left: 40px; right: 0; bottom: 0; transition: left .2s ease; }
/* Full screen: the rail tucks away; a thin strip at the left edge brings it back. */
body.fs .console-rail { transform: translateX(-34px); opacity: .35; }
body.fs .console-rail:hover, body.fs .console-rail:focus-within { transform: none; opacity: 1; }
body.fs #screen { left: 6px; }
.idle-warn { position: fixed; top: 12px; left: calc(50% + 20px); transform: translateX(-50%); z-index: 7; display: flex; gap: 12px; align-items: center;
  background-color: #2b2410; color: #ffe8a3; border: 1px solid #b7791f; border-radius: 8px; padding: 10px 14px; max-width: min(640px, calc(100vw - 72px)); font-size: 14px; }
.console-msg { position: absolute; inset: 0 0 0 40px; display: grid; place-items: center; color: #bbb; text-align: center; padding: 20px; }
@media (prefers-reduced-motion: reduce) { .console-rail, #screen, .console-name, .rail-btn { transition: none; } .rail-led.wait { animation: none; } }

@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; }
  .brand { margin: 0; order: 0; }
  #nav { order: 2; width: 100%; flex-direction: row; overflow-x: auto; }
  .nav-btn { padding: 6px 10px; white-space: nowrap; }
  .nav-btn[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
  main { padding: 20px 16px; }
  /* tables become stacked rows */
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  tr:last-child { border-bottom: 0; }
  td { border: 0; padding: 4px 14px; }
}

/* support */
.guide { display: grid; gap: 8px; max-width: 900px; }
.guide-head { margin: 18px 0 8px; font-size: 16px; }
.guide-item { padding: 0; }
.guide-item summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style-position: inside; }
.guide-item[open] summary { border-bottom: 1px solid var(--line); }
.guide-body { padding: 4px 18px 12px; }
.guide-body p { margin: 8px 0; }
pre.code { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font: 12px/1.5 var(--mono);
  white-space: pre-wrap; overflow-wrap: anywhere; }
p.tip { border-left: 3px solid var(--accent); padding: 4px 10px; background: var(--bg); border-radius: 0 6px 6px 0; }
.prose { padding: 16px 20px; margin-bottom: 12px; max-width: 900px; }
.prose h2 { margin: 0 0 8px; font-size: 16px; }
.prose p, .prose li { line-height: 1.55; }
.prose ul, .prose ol { padding-left: 20px; margin: 6px 0; }
.prose li { margin: 4px 0; }
ol.checklist li::marker { color: var(--accent); font-weight: 700; }
dl.kv.wide { grid-template-columns: max-content 1fr; font-size: 14px; }
.notice-line { max-width: 900px; font-size: 13px; color: var(--muted); border-left: 3px solid var(--warn); padding: 6px 10px; margin: 0 0 12px; }

.pick-list { border: 1px solid var(--line); border-radius: var(--radius); max-height: 300px; overflow: auto; margin: 6px 0 10px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-weight: 400; margin: 0; }
.pick:last-child { border-bottom: 0; }
.pick:hover { background: var(--bg); }
.pick input, .pick-all input { width: auto; margin: 0; }
.pick-main { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.pick-main .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-all { margin: 10px 0 0; font-size: 14px; }
.pick-list .empty { padding: 18px 12px; }
details.paste { margin: 4px 0 6px; }
details.paste summary { cursor: pointer; font-size: 14px; color: var(--accent); font-weight: 600; margin-bottom: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pick.done { cursor: default; opacity: .6; }
.pick.done:hover { background: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-tag { font-size: 11.5px; font-weight: 500; letter-spacing: .03em; opacity: .62; font-style: italic; }
@media (max-width: 900px) { .rail .brand-tag { display: none; } }
table.grouped tr.child-row td { background: color-mix(in srgb, var(--bg) 60%, transparent); padding-top: 7px; padding-bottom: 7px; }
table.grouped tr.group-row:has(+ tr.child-row:not([hidden])) td { border-bottom-style: dashed; }
.who { display: flex; flex-direction: column; line-height: 1.25; }
.who-line { display: flex; align-items: center; gap: 6px; }
.twisty-btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--accent);
  font-weight: 600; font-size: 14px; padding: 2px 6px 2px 2px; margin-left: -2px; border-radius: 4px; white-space: nowrap; }
.twisty-btn:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.twisty-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.twisty { display: inline-grid; place-items: center; width: 14px; font-size: 12px; transition: transform .12s ease; }
.twisty-btn[aria-expanded="true"] .twisty { transform: rotate(90deg); }
.twisty-gap { display: inline-block; width: 0; }
.child-lab { padding-left: 14px; border-left: 2px solid var(--line); }
.pill-row { display: flex; flex-wrap: wrap; gap: 4px; }
.table-tools { color: var(--muted); margin: 0 0 8px; }
.warn-list { margin: 0 0 12px 18px; padding: 0; }
.warn-list li { margin: 2px 0; }
.notice-line { background: color-mix(in srgb, var(--warn) 16%, transparent); border-left: 3px solid var(--warn); padding: 8px 10px; border-radius: 4px; }
.pill-row .pill { white-space: nowrap; }
.pick-note { white-space: nowrap; color: var(--ok); font-weight: 600; }
.pick-note.muted { color: var(--muted); font-weight: 400; }
.table-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.dot-sep { opacity: .5; }
.link-btn.quiet { color: var(--muted); font-weight: 500; font-size: 13px; }
.link-btn.quiet:hover { color: var(--accent); }
.menu-wrap { position: relative; display: inline-block; }
.menu-link { color: var(--muted); font-weight: 500; font-size: 13px; }
.menu-link:hover, .menu-link[aria-expanded="true"] { color: var(--accent); }
.mini-menu { position: absolute; left: 0; top: calc(100% + 4px); z-index: 20; min-width: 190px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px #0002; padding: 6px; }
.menu-item[disabled] { opacity: .45; cursor: default; }
.menu-item[disabled]:hover { background: none; }

/* collapsible sections */
.csec { margin-top: 4px; }
.sec-toggle { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; border-radius: 6px; padding: 2px 6px 2px 2px; margin-left: -2px; }
.sec-toggle h2 { margin: 0; }
.sec-toggle:hover h2 { color: var(--accent); }
.sec-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sec-toggle .twisty { color: var(--muted); transform: rotate(0deg); }
.sec-toggle[aria-expanded="true"] .twisty { transform: rotate(90deg); }
/* compact row actions */
.btn-row.nowrap { flex-wrap: nowrap; max-width: none; }
.more-btn { min-width: 30px; padding-left: 8px; padding-right: 8px; font-weight: 700; letter-spacing: .05em; }
.mini-menu.right { left: auto; right: 0; }

/* list toolbars: actions sit just above the table, right-aligned */
.search-row { flex-wrap: wrap; }
input.search.compact-search { max-width: 300px; padding: 4px 10px; font-size: 13px; }
.who strong { white-space: nowrap; }
table.grouped td a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
table.grouped td a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.title-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* larger expand/collapse arrows (site-wide) */
.twisty { width: 22px; height: 22px; font-size: 15px; line-height: 1; display: inline-grid; place-items: center;
  border-radius: 6px; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.twisty-btn { gap: 8px; font-size: 14px; }
.twisty-btn:hover .twisty, .sec-toggle:hover .twisty { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.sec-toggle .twisty { color: var(--accent); }
dl.auto-kv { display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; margin: 0; white-space: nowrap; }
dl.auto-kv dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; align-self: center; }
dl.auto-kv dd { margin: 0; }
dl.auto-kv .link-btn { font-size: inherit; }
.net-link { font-size: inherit !important; }
.net-link { font-weight: 500; font-size: 12.5px !important; border-bottom: 1px dashed currentColor; border-radius: 0; line-height: 1.3; }
.net-link { white-space: nowrap; }

/* =====================================================================
   Theme: "lab bench" - indigo rack rail with a breadboard dot grid,
   indicator-LED statuses, Poppins for titles. Overrides earlier rules.
   ===================================================================== */
@font-face { font-family: "Poppins"; src: url("/static/fonts/poppins-500.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/static/fonts/poppins-700.woff") format("woff"); font-weight: 700; font-display: swap; }
body { -webkit-font-smoothing: antialiased; }
h1 { font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: -.015em; line-height: 1.15; }
h2 { font-family: var(--display); font-weight: 500; font-size: 18px; letter-spacing: -.005em; }
dialog h2 { font-weight: 700; font-size: 19px; }

/* rail: an equipment rack with breadboard dots */
.rail { background-color: var(--rail);
  background-image: radial-gradient(circle at 1px 1px, #ffffff12 1px, transparent 1.4px), linear-gradient(180deg, #ffffff06, transparent 40%);
  background-size: 16px 16px, 100% 100%; border-right: 1px solid #ffffff0d; }
.brand { font-family: var(--display); letter-spacing: 0; }
.brand-word { font-size: 19px; font-weight: 700; }
.brand-mark { width: 32px; height: 32px; filter: drop-shadow(0 3px 8px #ee5a1255); }
.nav-btn { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; font-weight: 500; font-size: 14.5px;
  position: relative; transition: background-color .15s ease, color .15s ease; }
.nav-btn::before { content: ""; width: 19px; height: 19px; flex: none; background: currentColor; opacity: .75;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.nav-btn[aria-current="page"] { background: #ffffff14; color: #fff; box-shadow: none; }
.nav-btn[aria-current="page"]::before { background: var(--accent); opacity: 1; }
.nav-btn[aria-current="page"]::after { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0;
  background: var(--accent); box-shadow: 0 0 12px #ee5a12aa; }
.nav-btn[data-view="courses"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9.5 12 5l9 4.5-9 4.5z'/%3E%3Cpath d='M7 11.6V16c0 1.2 2.2 2.5 5 2.5s5-1.3 5-2.5v-4.4'/%3E%3Cpath d='M21 9.5V14'/%3E%3C/svg%3E"); }
.nav-btn[data-view="deployed"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='12' rx='2'/%3E%3Cpath d='M8 20h8M12 16v4'/%3E%3Ccircle cx='7' cy='8' r='.6' fill='black'/%3E%3C/svg%3E"); }
.nav-btn[data-view="users"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.2'/%3E%3Cpath d='M3.5 19c.6-3.1 2.8-5 5.5-5s4.9 1.9 5.5 5'/%3E%3Ccircle cx='17' cy='9' r='2.4'/%3E%3Cpath d='M16.5 14.2c2.2.2 3.7 1.8 4.1 4.3'/%3E%3C/svg%3E"); }
.nav-btn[data-view="orgs"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V6l8-3 8 3v14'/%3E%3Cpath d='M9 20v-4h6v4M8 9h.01M12 9h.01M16 9h.01M8 12.5h.01M12 12.5h.01M16 12.5h.01'/%3E%3C/svg%3E"); }
.nav-btn[data-view="build"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 3 7.5l9 4.5 9-4.5z'/%3E%3Cpath d='m3 12 9 4.5 9-4.5'/%3E%3Cpath d='m3 16.5 9 4.5 9-4.5'/%3E%3C/svg%3E"); }
.nav-btn[data-view="support"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9.6 9.4a2.5 2.5 0 0 1 4.8.9c0 1.7-2.4 2.2-2.4 3.7'/%3E%3Cpath d='M12 17.2h.01'/%3E%3C/svg%3E"); }
.nav-btn[data-view="labs"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='12' rx='2'/%3E%3Cpath d='M8 20h8M12 16v4'/%3E%3Cpath d='m10.5 8 3 2-3 2z'/%3E%3C/svg%3E"); }

/* surfaces */
.panel, .fact, .card { box-shadow: var(--shadow); }
th { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); background: color-mix(in srgb, var(--bg) 45%, var(--panel)); }
thead tr:first-child th:first-child { border-top-left-radius: var(--radius); }
thead tr:first-child th:last-child { border-top-right-radius: var(--radius); }
tbody tr:hover td { background: color-mix(in srgb, var(--accent) 3%, transparent); }
dl.auto-kv dt, .fact-label { text-transform: none; letter-spacing: 0; font-size: 12px; }

/* buttons */
.btn { border-radius: 8px; transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.btn.primary { box-shadow: 0 1px 0 #00000014, inset 0 1px 0 #ffffff2e; }
.btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, #000); border-color: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.sm { border-radius: 6px; }

/* status pills as indicator LEDs */
.pill { background: var(--panel); border-color: var(--line); font-weight: 600; }
.pill::before { width: 8px; height: 8px; box-shadow: inset 0 0 0 1px #0000001a; }
.pill.running::before, .pill.online::before { background: var(--led); box-shadow: 0 0 0 3px color-mix(in srgb, var(--led) 22%, transparent), 0 0 8px var(--led); }
.pill.running { color: var(--ok); border-color: color-mix(in srgb, var(--led) 40%, var(--line)); }
.pill.ready::before, .pill.active::before { background: var(--led); }
.pill.error { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.pill.error::before { box-shadow: 0 0 6px var(--bad); }
.pill.provisioning::before, .pill.deleting::before { box-shadow: 0 0 6px var(--warn); }

/* tabs */
.tab { font-family: var(--display); font-weight: 500; }
.tab.on { border-bottom-width: 3px; }

/* toasts */
.toast { background: var(--rail); border-left: 4px solid var(--led); }
.toast.bad { border-left-color: #fff8; }

/* ---------- sign-in: the lab comes alive ---------- */
.login-wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr); place-items: stretch; padding: 0; background: var(--bg); }
.login-hero { position: relative; overflow: hidden; color: #fff; padding: 56px 56px 40px; display: flex; flex-direction: column; justify-content: space-between;
  background-color: var(--rail);
  background-image: radial-gradient(circle at 1px 1px, #ffffff14 1px, transparent 1.4px), radial-gradient(ellipse at 85% 110%, #ee5a1233, transparent 55%);
  background-size: 18px 18px, 100% 100%; }
.login-hero .brand { color: #fff; margin: 0; }
.hero-title { font-family: var(--display); font-weight: 700; font-size: clamp(38px, 4.6vw, 60px); line-height: 1.02; letter-spacing: -.03em; margin: 40px 0 14px; max-width: 12ch; }
.hero-sub { font-size: 17px; line-height: 1.5; color: #c9cfe6; max-width: 34ch; margin: 0; }
.topo { width: 100%; max-width: 560px; margin: 28px 0 0; align-self: center; }
.topo .wire { stroke: #ffffff2a; stroke-width: 2; fill: none; }
.topo .flow { stroke: var(--accent); stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-dasharray: 2 26; opacity: 0;
  animation: flow 1.6s linear infinite, appear .4s ease forwards; }
.topo .node rect { fill: #252d5c; stroke: #ffffff30; stroke-width: 1.5; }
.topo .node .scr { fill: #10163a; }
.topo .node .led { fill: #39405f; }
.topo .node { animation: none; }
.topo .node .led { animation: led-on .35s ease forwards; }
.topo .gw circle { fill: var(--accent); }
.topo .gw .ring { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: .5; transform-origin: center; transform-box: fill-box; animation: ring 2.6s ease-out infinite; }
.topo .lbl { fill: #c3c9e0; font: 500 11px var(--display); }
@keyframes flow { to { stroke-dashoffset: -28; } }
@keyframes appear { to { opacity: .9; } }
@keyframes led-on { to { fill: var(--led); filter: drop-shadow(0 0 4px #39e08a); } }
@keyframes ring { from { transform: scale(1); opacity: .55; } to { transform: scale(2.2); opacity: 0; } }
.login-side { display: grid; place-items: center; padding: 32px 24px; }
.login { width: min(380px, 100%); padding: 34px 32px; border-radius: 14px; }
.login h1 { font-size: 24px; margin: 0 0 4px; }
.login .lead { color: var(--muted); margin: 0 0 8px; font-size: 14px; }
.login .brand { display: none; }
.hero-foot { color: #8f98bd; font-size: 12.5px; margin-top: 24px; }
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: minmax(0, 1fr); }
  .login-hero { padding: 28px 24px 24px; }
  .hero-title { font-size: 36px; margin-top: 22px; }
  .topo, .hero-foot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .topo .flow, .topo .gw .ring { animation: none; opacity: .6; }
  .topo .node .led { animation: none; fill: var(--led); }
  .nav-btn, .btn { transition: none; }
}

.topo .flow.d1 { animation-delay: 1.05s, 1.05s; }
.topo .node .led.d1 { animation-delay: 0.45s; }
.topo .flow.d2 { animation-delay: 1.20s, 1.20s; }
.topo .node .led.d2 { animation-delay: 0.60s; }
.topo .flow.d3 { animation-delay: 1.35s, 1.35s; }
.topo .node .led.d3 { animation-delay: 0.75s; }
.topo .flow.d4 { animation-delay: 1.50s, 1.50s; }
.topo .node .led.d4 { animation-delay: 0.90s; }
.topo .flow.d5 { animation-delay: 1.65s, 1.65s; }
.topo .node .led.d5 { animation-delay: 1.05s; }
.topo .flow.d6 { animation-delay: 1.80s, 1.80s; }
.topo .node .led.d6 { animation-delay: 1.20s; }
/* a running lab glows a little, like a powered-on machine */
.card:has(.pill.running) { border-color: color-mix(in srgb, var(--led) 45%, var(--line));
  box-shadow: var(--shadow), 0 0 0 3px color-mix(in srgb, var(--led) 12%, transparent); }
.card h3 { font-family: var(--display); font-weight: 700; font-size: 17px; }
@media (max-width: 760px) { .nav-btn[aria-current="page"]::after { display: none; } }

/* ===== page banner: one slim dark band — small line + title on the left, the page's actions on the right ===== */
main { padding-top: 18px; }
.page-head.banner { align-items: center; gap: 10px 20px; margin: 4px 0 18px; padding: 14px 20px; border-radius: 12px;
  color: #fff; background-color: var(--banner);
  background-image: radial-gradient(circle at 1px 1px, #ffffff12 1px, transparent 1.4px), radial-gradient(ellipse 45% 160% at 100% 0%, #ee5a1240, transparent 60%);
  background-size: 16px 16px, 100% 100%; }
.page-title { min-width: 0; }
.banner h1 { color: #fff; font-size: 22px; }
.banner .crumb-line { margin-bottom: 2px; font-size: 12.5px; color: #aab2cf; }
.banner .crumb-line .muted { color: #aab2cf; }
.banner .crumb { color: #c9cfe6; text-decoration: none; }
.banner .crumb:hover { color: #fff; }
.banner .btn { background: #ffffff14; border-color: #ffffff2e; color: #fff; padding: 4px 11px; font-size: 13px; }
.banner .btn:hover:not(:disabled) { background: #ffffff24; border-color: #ffffff55; }
.banner .btn.primary { background: var(--accent); border-color: var(--accent); }
.banner .btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 760px) { .page-head.banner { padding: 12px 14px; } .banner h1 { font-size: 20px; } }

/* coloured initials */
.av { width: 30px; height: 30px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; color: #fff;
  font: 700 11.5px/1 var(--display); letter-spacing: .02em; box-shadow: inset 0 0 0 2px #ffffff26; }
.av.sq { border-radius: 9px; width: 34px; height: 34px; font-size: 12.5px; }
.who-av { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pick .av { width: 26px; height: 26px; font-size: 10.5px; }

/* empty states get a little machine */
.panel.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 34px 24px; }
.panel.empty::before { content: ""; width: 76px; height: 57px; background: var(--accent); opacity: .55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 48' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='14' y='6' width='36' height='24' rx='3'/%3E%3Cpath d='M26 38h12M32 30v8'/%3E%3Cpath d='M8 20h4M52 20h4M20 42h-6M44 42h6' opacity='.5'/%3E%3Ccircle cx='44' cy='25' r='1.6' fill='black'/%3E%3Cpath d='m28 15 4 3-4 3' /%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 48' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='14' y='6' width='36' height='24' rx='3'/%3E%3Cpath d='M26 38h12M32 30v8'/%3E%3Cpath d='M8 20h4M52 20h4M20 42h-6M44 42h6' opacity='.5'/%3E%3Ccircle cx='44' cy='25' r='1.6' fill='black'/%3E%3Cpath d='m28 15 4 3-4 3' /%3E%3C/svg%3E") center / contain no-repeat; }

/* section headings get a small accent tick */
.sec-toggle h2 { font-weight: 700; }

table.grouped td .mono { white-space: nowrap; }

/* teacher view pill */
.tv-pill { display: inline-flex; align-items: center; gap: 8px; padding: 3px 6px 3px 4px; cursor: default; }
.tv-pill .av { width: 22px; height: 22px; font-size: 9.5px; }
.tv-pill .link-btn { font-size: 13px; color: var(--accent); }
.tv-exit { all: unset; cursor: pointer; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; font-size: 15px; color: var(--muted); }
.tv-exit:hover { background: var(--line); color: var(--ink); }
.tv-exit:focus-visible { outline: 2px solid var(--focus); }
.pick-btn { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick-btn:hover, .pick-btn:focus-visible { background: var(--bg); }
.admin-row { cursor: default; }
.admin-row:hover { background: none; }
.count-link { font-size: 14px; }

/* users table */
.name-link.strong { font-weight: 700; color: var(--ink); }
.role-tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap;
  background: color-mix(in srgb, var(--muted) 12%, transparent); color: var(--muted); }
.role-tag.instructor { background: color-mix(in srgb, #0fa3a3 14%, transparent); color: #0b8a8a; }
.role-tag.admin { background: color-mix(in srgb, #5b5bd6 14%, transparent); color: #4b4bc4; }
.role-tag.admin.platform { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
:root[data-theme="dark"] .role-tag.instructor { color: #4fd1d1; } :root[data-theme="dark"] .role-tag.admin { color: #a5a5ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .role-tag.instructor { color: #4fd1d1; } :root:not([data-theme="light"]) .role-tag.admin { color: #a5a5ff; } }

/* Users: columns hug their content; the actions column takes the leftover space */
.users-table th, .users-table td { width: 1%; white-space: nowrap; padding: 8px 18px 8px 12px; }
.users-table th:first-child, .users-table td:first-child { padding-left: 16px; }
.users-table th:last-child, .users-table td:last-child { width: auto; padding-right: 14px; }
.users-table .who-av { gap: 9px; }
.users-table .av { width: 28px; height: 28px; font-size: 11px; }
@media (max-width: 760px) { .users-table th, .users-table td { width: auto; white-space: normal; } }
/* actions sit right after Status instead of at the far edge */
.users-table table { width: auto; }
.users-table th, .users-table td, .users-table th:last-child, .users-table td:last-child { width: auto; }
.users-table th:not(:last-child), .users-table td:not(:last-child) { padding-right: 28px; }
@media (max-width: 760px) { .users-table table { width: 100%; } }
.users-table .panel { width: fit-content; max-width: 100%; }
.users-table .panel.empty { width: auto; }
@media (max-width: 760px) { .users-table .panel { width: auto; } }
.dlg-side-actions { display: flex; gap: 6px; margin-right: auto; flex-wrap: wrap; }
.users-table .name-link.strong { border-bottom: 1px solid var(--line); }
.users-table .name-link.strong:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* network designs */
.seg-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 0; row-gap: 6px; }
.seg-cloud { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 3px 9px; border: 1px dashed var(--line); border-radius: 999px; }
.seg-wire { width: 16px; height: 2px; background: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.seg-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 7px;
  background: color-mix(in srgb, #5b5bd6 10%, var(--panel)); border: 1px solid color-mix(in srgb, #5b5bd6 30%, var(--line)); white-space: nowrap; }
.seg-chip.gw { background: color-mix(in srgb, var(--accent) 12%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.seg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--led); box-shadow: 0 0 6px var(--led); }
.edit-rows { display: grid; gap: 6px; margin: 6px 0 8px; }
.edit-row { display: flex; align-items: center; gap: 8px; }
.edit-row input, .edit-row select { flex: 1; min-width: 0; padding: 6px 9px; }
.gw-pick { margin: 0; white-space: nowrap; font-size: 13px; }
.nic-name { min-width: 90px; }
dialog:has(.wide-form) { width: min(640px, 94vw); }
.netintro { padding: 24px 26px; max-width: 760px; }
.netintro h2 { margin-top: 0; }
.netintro .seg-strip { margin: 14px 0; }
.steps-list { margin: 8px 0 18px 20px; padding: 0; } .steps-list li { margin: 4px 0; }
.seg-extra { white-space: nowrap; }
/* sign-in: a smaller topology picture */
.login-hero { padding: 44px 48px 32px; }
.hero-title { font-size: clamp(32px, 3.4vw, 46px); margin: 32px 0 12px; }
.hero-sub { font-size: 16px; }
.topo { max-width: 400px; margin: 22px 0 0; align-self: flex-start; }
.login-foot { text-align: center; margin: 16px 0 0; font-size: 13px; }
.login-foot a { color: var(--muted); }
.login-foot a:hover { color: var(--accent); }

/* ---------------------------------------------------------------- learning systems (LTI 1.3) */
.lms-chip { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: var(--bg); white-space: nowrap; }
.lms-chip.canvas { color: #c2341d; border-color: #e3412433; background: #e341240f; }
.lms-chip.blackboard { color: var(--ink); border-color: #16203a33; background: #16203a0d; }
:root[data-theme="dark"] .lms-chip.canvas { color: #ff8a70; }
.lms-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; font-size: 14px; }
.lms-guide { padding: 16px 18px; margin-top: 16px; }
.lms-guide h2 { font-size: 16px; margin: 0; }
.lms-guide .steps { margin: 12px 0 14px; padding-left: 20px; line-height: 1.55; font-size: 14px; }
.lms-guide .steps li + li { margin-top: 4px; }
.small-tabs { border-bottom: 0; margin: 0; }
.small-tabs .tab { background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: 13px; padding: 6px 10px; }
.copy-list { display: grid; gap: 8px; margin-bottom: 12px; }
.copy-row { display: grid; grid-template-columns: minmax(150px, 220px) 1fr auto; gap: 10px; align-items: center; }
.copy-label { font-weight: 600; font-size: 13px; }
.copy-val { font-family: var(--mono); font-size: 12.5px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px;
  overflow-wrap: anywhere; user-select: all; }
.lti-panel { padding: 18px 20px; max-width: 760px; }
.lti-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 14px; }
.lti-choice > div { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.lti-choice h3 { margin: 0; font-size: 15px; }
.lti-choice select { width: 100%; }
@media (max-width: 640px) { .copy-row { grid-template-columns: 1fr auto; } .copy-label { grid-column: 1 / -1; } }

/* standalone launch pages (/lti/...), which can appear inside the learning system's frame */
body.lti-page { display: grid; place-items: center; min-height: 100vh; margin: 0; padding: 16px; background-color: var(--bg); color: var(--ink); font-family: var(--sans); }
.lti-card { max-width: 460px; padding: 26px 28px; text-align: center; box-shadow: var(--shadow); }
.lti-card h1 { font-family: var(--display); font-size: 22px; margin: 0 0 10px; }
.lti-card p { line-height: 1.5; }
.lti-card .btn { display: inline-block; text-decoration: none; }

/* ---------------------------------------------------------------- product key card (licensing on only) */
.license-card textarea { width: 100%; font-family: var(--mono); font-size: 12.5px; }
.lic-grid { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 6px 0 12px; }
.lic-grid > div { display: grid; gap: 2px; }
.lic-usage { width: auto; border-collapse: collapse; margin: 0 0 10px; font-size: 14px; }
.lic-usage th { text-align: left; font-weight: 600; padding: 3px 24px 3px 0; background: none; border: 0; }
.lic-usage td { border: 0; }
.lic-usage td { padding: 3px 0; }

/* banner status line: small, quiet counts (e.g. "48 VMs · ● 17 running") */
.banner-side { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.b-stats { margin: 0; font-size: 12px; color: #aab2cf; display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; }
.b-stat { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.b-stat strong { color: #e6e9f4; font-weight: 600; font-variant-numeric: tabular-nums; }
.b-sep { margin: 0 6px; opacity: .6; }
.b-led { width: 6px; height: 6px; border-radius: 50%; background-color: var(--led); box-shadow: 0 0 5px #1fb86a99; }

/* Linked VMs of a template */
dialog:has(.clones-dialog), dialog:has(.student-panel) { width: min(660px, 94vw); }
.clone-groups { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow: auto; margin: 8px 0; }
.clone-group { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.clone-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 6px; }
.clone-list { list-style: none; margin: 0; padding: 0; }
.clone-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid var(--line); }
.stamp { font-size: 11.5px; color: var(--muted); opacity: .85; font-variant-numeric: tabular-nums; }
.date-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Support → Guides: section chips */
.guide-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.guide-chip { font: inherit; font-size: 13px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background-color: var(--panel); color: var(--ink); cursor: pointer; }
.guide-chip:hover { border-color: var(--muted); }
.guide-chip.on { background-color: var(--banner); border-color: var(--banner); color: #fff; }
.guide-crumb { margin: 10px 0 2px; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }

/* Student panel (VMs page / course page → click a student's name) */
.sp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sp-head h2 { margin: 0; }
.sp-head .av { width: 40px; height: 40px; font-size: 15px; }
.sp-courses { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow: auto; margin: 6px 0 4px; }
.student-panel .clone-list li { flex-wrap: wrap; }
.sp-vm { min-width: 0; overflow-wrap: anywhere; }
.sp-act { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tabs { min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs .tab { white-space: nowrap; }
.bar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.bar-note { margin: 0; min-width: 0; }

/* VMs page: machine-first rows grouped by course */
.course-group .twisty-btn { font-weight: 600; }
.course-group .who-line { gap: 10px; flex-wrap: wrap; }

/* VM panel (VMs page → click a VM name) */
dialog:has(.vm-panel) { width: min(560px, 94vw); }
.vm-panel .sp-head h2 { margin: 0 0 4px; font-size: 18px; overflow-wrap: anywhere; }
.vm-panel .kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0 0; }
.vm-panel .kv dt { color: var(--muted); }
.vm-panel .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.actions.wrap { flex-wrap: wrap; }

/* Templates → Revisions */
#revisions .csec { margin-top: 8px; }
.sec-note { margin: 0 0 10px; }
.rev-hit { font-weight: 600; color: var(--accent); }

/* Containers */
.kind-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  vertical-align: middle; color: var(--accent); background-color: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }


/* VMs page → Network → internet dialog */
.scope-list { display: grid; gap: 8px; margin: 4px 0 6px; }
.scope-opt { align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.scope-opt input { margin-top: 3px; }
.scope-opt > span { display: flex; flex-direction: column; gap: 2px; }
.scope-opt:has(input:checked) { border-color: var(--accent); }
.scope-opt.muted { cursor: not-allowed; }

/* Courses list: Idle timeout / Auto-delete values open their settings */
.link-btn.course-set { font-size: 14px; }
.link-btn.course-set.warn { color: var(--warn); }
