:root {
  /* Light theme to match the Elefair master admin (api.elefair.app) */
  --bg: #f5f5f8; --panel: #ffffff; --panel-2: #f3f3f7; --line: #e7e7ee;
  --ink: #1b1b2b; --ink-soft: #5c5c70; --ink-faint: #9a9aae;
  --accent: #5b5bd6; --accent-deep: #4a4ac2; --accent-soft: #eeeefb;
  --ok: #1f9d57; --warn: #c6881f; --danger: #d6554b;
  --stage: #0e1116; --radius: 12px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Consolas", monospace;
  --shadow: 0 1px 2px rgba(27,27,43,.04), 0 4px 16px rgba(27,27,43,.06);
  --shadow-sm: 0 1px 2px rgba(27,27,43,.05);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--ink-faint); }
.err { color: var(--danger); min-height: 18px; margin: 4px 0; font-size: 13px; }
.spacer { flex: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 11px; padding: 9px 14px; cursor: pointer; transition: all .12s; box-shadow: var(--shadow-sm); }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; box-shadow: 0 4px 14px rgba(91,91,214,.3); }
.btn.primary:hover { background: var(--accent-deep); }
.btn.small { padding: 6px 11px; font-size: 12.5px; }
.btn.ghost { background: transparent; border-color: rgba(255,255,255,.4); color: #fff; }
.btn.ghost:hover { border-color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.wide { width: 100%; }

/* login */
.login { height: 100%; display: grid; place-items: center; padding: 20px; }
.login-box { width: 330px; display: flex; flex-direction: column; gap: 10px; text-align: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 36px 30px;
  box-shadow: 0 10px 40px rgba(27,27,43,.1); }
.logo-lg { width: 54px; height: 54px; border-radius: 14px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 24px; margin: 0 auto; }
.login-box h1 { margin: 6px 0 0; font-size: 20px; }
.login-box .muted { margin: 0 0 8px; font-size: 13px; }
.login-box input { padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }

/* console */
.console { height: 100%; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 10px; color: #fff; padding: 7px 16px;
  background: linear-gradient(135deg, #6a6ae0 0%, var(--accent) 55%, var(--accent-deep) 100%);
  box-shadow: 0 2px 12px rgba(74,74,194,.28); position: relative; z-index: 3;
}
.logo { width: 27px; height: 27px; border-radius: 8px; background: rgba(255,255,255,.2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 13px; }
.brand-name { font-weight: 650; font-size: 14px; letter-spacing: .2px; line-height: 1.15; }
.brand-sub { font-size: 10.5px; color: #e0e0fb; line-height: 1.15; }
.conn-state { font-size: 12px; color: #e3e3fb; }

.work { flex: 1; display: grid; grid-template-columns: 300px 1fr; min-height: 0; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.side-head h2 { margin: 0 0 2px; font-size: 13px; }
.side-head p { margin: 0; font-size: 11.5px; color: var(--ink-faint); }
.list { flex: 1; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.list:empty::before { content: "No customers online yet."; color: var(--ink-faint); font-size: 12.5px; padding: 10px; display: block; }
/* sidebar as a compact one-line-per-row table */
.cust { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border: 1px solid transparent;
  border-radius: 8px; cursor: pointer; background: transparent; width: 100%; text-align: left; color: inherit; transition: background .12s; }
.cust:hover { background: var(--panel-2); }
.cust.active { background: var(--accent-soft); border-color: var(--accent); }
.cust.off { opacity: .55; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.on { background: var(--ok); } .dot.offl { background: var(--ink-faint); }
.cust .info { min-width: 0; flex: 1; display: flex; flex-direction: row; align-items: baseline; gap: 8px; overflow: hidden; }
.cust .nm { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; max-width: 48%; }
.cust .id { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); letter-spacing: .5px; white-space: nowrap; }

.connect { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.connect label { font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .5px; }
.connect-row { display: flex; gap: 8px; }
.connect input { flex: 1; min-width: 0; font-family: var(--mono); padding: 10px 11px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--bg); color: var(--ink); }
.connect input#idin { font-size: 15px; letter-spacing: 2px; }
.passin { max-width: 110px; }

.stage-wrap { display: flex; flex-direction: column; min-height: 0; }
.stage-bar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.who { font-weight: 600; font-size: 14px; }
.meta { font-size: 12px; color: var(--ink-soft); font-family: var(--mono); }
.ctl-group { display: flex; gap: 8px; align-items: center; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; user-select: none; }
.switch { width: 34px; height: 19px; border-radius: 10px; background: var(--line); position: relative; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.toggle.on .switch { background: var(--accent); }
.toggle.on .switch::after { transform: translateX(15px); }
.toggle.on { color: var(--ink); }

/* full session view — the remote fills the area, white background, no frame */
.session-view { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.stage { flex: 1; margin: 0; overflow: hidden; background: #fff;
  position: relative; display: grid; place-items: center; }
/* pinned to the stage box so a wide/short window never cuts off the bottom (taskbar) */
#video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.stage.controlling #video { cursor: none; }
.stat { position: absolute; bottom: 12px; right: 14px; font-family: var(--mono); font-size: 11px; color: #e8edf3;
  background: rgba(0,0,0,.5); padding: 3px 8px; border-radius: 6px; }

/* ---------- VM monitoring wall ---------- */
.vm-wall { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.wall-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.wall-title { font-weight: 650; font-size: 14px; }
.wall-count { font-size: 12px; color: var(--ink-faint); }
.pager { display: flex; align-items: center; gap: 8px; }

/* multi-monitor selector (session bar) */
.mon-bar { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; }
.mon-label { font-size: 12px; color: var(--ink-faint); }
.mon-chip { padding: 5px 10px; font-size: 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; white-space: nowrap; }
.mon-chip.on { background: var(--brand, #6366f1); border-color: transparent; color: #fff; }

/* Beam students — a full page inside the main panel */
.students-view { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.students-body { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 20px; }
.st-search { width: min(300px, 44vw); padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 13px; }
.st-search:focus { outline: none; border-color: var(--brand, #6366f1); }
@media (max-width: 560px) { .st-search { width: 150px; } .wall-bar { flex-wrap: wrap; } }
.page-info { font-size: 12.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.vm-grid { flex: 1; overflow-y: auto; padding: 16px; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); align-content: start; align-items: start; }
.wall-empty { padding: 28px 20px; color: var(--ink-faint); font-size: 13px; text-align: center; }
.wall-empty[hidden] { display: none; }

.vm-tile { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .08s; }
.vm-thumb { flex: 0 0 auto; }
.vm-meta { flex: 0 0 auto; }
.vm-tile:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(27,27,43,.1); }
.vm-tile:active { transform: scale(.995); }
.vm-tile.offline { cursor: default; opacity: .72; }
.vm-tile.offline:hover { border-color: var(--line); box-shadow: var(--shadow-sm); }
.vm-thumb { position: relative; aspect-ratio: 16 / 9; background: #0e1116; display: grid; place-items: center; }
.vm-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vm-img[hidden] { display: none; }
.vm-noimg { color: #8a93a3; font-size: 12px; }
.vm-noimg[hidden] { display: none; }
.vm-badge { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 600; color: #fff; padding: 3px 9px; border-radius: 999px;
  background: rgba(14,17,22,.68); backdrop-filter: blur(3px); }
.vm-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); }
.vm-badge.idle .vm-dot { background: #27e07a; }
.vm-badge.live .vm-dot { background: #ff4d4d; box-shadow: 0 0 0 3px rgba(255,77,77,.3); }
.vm-badge.offline .vm-dot { background: #8a93a3; }
.vm-badge.live { background: rgba(214,85,75,.85); }
.vm-meta { padding: 9px 12px 11px; }
.vm-id { font-size: 12.5px; color: var(--ink); letter-spacing: .5px; }
.vm-student { font-size: 12px; color: var(--ink-soft); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: 9px; font-size: 13.5px; z-index: 20; box-shadow: 0 6px 20px rgba(0,0,0,.2); }

@media (max-width: 760px) {
  .work { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
  .vm-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 12px; }
  /* nothing may push the page wider than the phone */
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 6px 8px; }
  .topbar .spacer { flex-basis: 100%; height: 0; }
  /* session controls stay on ONE line that scrolls sideways, instead of wrapping */
  .stage-bar { flex-wrap: nowrap; overflow-x: auto; gap: 10px; padding: 10px 12px; -webkit-overflow-scrolling: touch; }
  .stage-bar > * { flex: 0 0 auto; }
  .stage-bar .spacer { display: none; }
  .ctl-group { flex-wrap: nowrap; gap: 8px; }
  .mon-bar { flex-wrap: nowrap; margin-right: 0; }
  .who, .meta { white-space: nowrap; }
  .connect-row { flex-wrap: wrap; }
  .connect input, .passin { max-width: 100%; }
  .wall-bar { flex-wrap: wrap; gap: 8px; }
  /* On phones let the whole page scroll as one document instead of nested fixed
     panes — stops cards overlapping. The footer stays pinned to the bottom when
     content is short, and flows after content when it's tall (sticky footer). */
  html, body { height: auto; }
  body { min-height: 100vh; }
  .console { height: auto; min-height: 100vh; }
  .work { display: block; flex: 1 0 auto; }
  .foot { flex: 0 0 auto; }
  .side { max-height: none; border-bottom: 1px solid var(--line); }
  .stage-wrap, .vm-wall, .students-view { display: block; min-height: 0; }
  .vm-grid, .students-body { overflow: visible; }
  .vm-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
/* Watching a VM on a phone (either orientation): the remote fills the whole
   screen; the controls live in a floating button (styles below). */
@media (max-width: 760px), (max-height: 600px) {
  .console.in-session .topbar,
  .console.in-session .foot,
  .console.in-session .side,
  .console.in-session .stage-bar { display: none; }
  .console.in-session,
  .console.in-session .work,
  .console.in-session .stage-wrap,
  .console.in-session .session-view { display: block; height: auto; min-height: 0; }
  .console.in-session .session-view { position: fixed; inset: 0; }
  .console.in-session .stage { position: absolute; inset: 0; flex: none; height: auto; max-height: none; margin: 0; }
  .console.in-session .fab { display: grid; }
}

/* ---------- floating control button + icon menu (phones, in a VM session) ---------- */
.fab { display: none; }
.console.in-session .fab {
  position: fixed; z-index: 11; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  place-items: center; color: #fff; touch-action: none;
  background: rgba(40,42,70,.72); backdrop-filter: blur(8px); box-shadow: 0 6px 20px rgba(0,0,0,.4);
  transition: background .15s, transform .12s;
}
.console.in-session .fab:active { transform: scale(.94); }
.console.in-session .fab svg { width: 24px; height: 24px; }
body.menu-open .console.in-session .fab { background: var(--brand, #6366f1); }
.fab-menu {
  position: fixed; z-index: 11; min-width: 230px;
  right: 16px; bottom: 80px;
  background: #ffffff; border-radius: 16px; padding: 8px;
  box-shadow: 0 16px 48px rgba(0,0,0,.28); border: 1px solid rgba(0,0,0,.07);
  transition: opacity .14s ease, transform .14s ease;
}
.fab-menu[hidden] { display: none; }
.fab-menu.opening, .fab-menu.closing { opacity: 0; transform: translateY(8px) scale(.96); }
.fab-status { display: flex; align-items: center; gap: 7px; padding: 6px 10px 8px; color: #6b7280; font-size: 12px; }
.fab-status .fab-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; flex: none; }
.fab-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; cursor: pointer;
  background: transparent; color: #1f2430; font-size: 14.5px; font-weight: 500; border-radius: 10px; text-align: left; }
.fab-item > span:first-of-type { flex: 1; }
.fab-item svg { width: 21px; height: 21px; flex: none; color: #6b7280; }
.fab-item:hover, .fab-item:active { background: rgba(0,0,0,.055); }
.fab-item.danger, .fab-item.danger svg { color: #dc2626; }
.fab-item.on { background: rgba(99,102,241,.12); color: #4f46e5; }
.fab-item.on svg { color: #4f46e5; }
.fab-tog { font-size: 11px; color: #6b7280; border: 1px solid #d1d5db; border-radius: 6px; padding: 1px 7px; }
.fab-item.on .fab-tog { color: #fff; border-color: transparent; background: var(--brand, #6366f1); }
.fab-menu .mon-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 8px 8px; margin: 0; }
.fab-menu .mon-bar[hidden] { display: none; }
.fab-menu .mon-chip { padding: 7px 11px; font-size: 12.5px; border-radius: 9px; border: 1px solid #e5e7eb; background: #f4f5f7; color: #374151; cursor: pointer; white-space: nowrap; }
.fab-menu .mon-chip.on { background: var(--brand, #6366f1); border-color: transparent; color: #fff; }
/* never allow a sideways scroll of the whole console on phones */
html, body { max-width: 100%; }
body { overflow-x: hidden; }
.topbar, .stage-bar, .connect, .connect-row, .side { min-width: 0; }

/* Footer */
.foot { padding: 9px 18px; border-top: 1px solid var(--line); background: var(--panel);
  color: var(--ink-faint); font-size: 11.5px; text-align: center; }

/* Reverse screen share (admin -> user) */
.share-flag { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: var(--accent);
  color: #fff; font-size: 11.5px; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.btn.small.sharing { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Saved (offline) customers in the list */
.cust .saved-tag { font-size: 9px; color: var(--ink-faint); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 6px; margin-left: auto; flex: none; }
.cust .forget { border: 0; background: transparent; color: var(--ink-faint);
  cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; opacity: 0; flex: none; }
.cust:hover .forget { opacity: 1; }
.cust .forget:hover { color: var(--danger); }
.login { flex-direction: column; }
.login-foot { position: fixed; bottom: 16px; left: 0; right: 0; text-align: center; color: var(--ink-faint); font-size: 11.5px; }

/* ---------- Elefair Beam: student management panel ---------- */
.panel-overlay { position: fixed; inset: 0; background: rgba(27,27,43,.5); display: grid; place-items: center; z-index: 30; padding: 16px; }
.panel { width: min(1500px, 96vw); height: 92vh; max-height: 92vh; overflow-y: auto; background: var(--panel); border-radius: 16px; box-shadow: 0 24px 70px rgba(27,27,43,.35); }
@media (max-width: 560px) { .panel-overlay { padding: 0; } .panel { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; } }
.panel-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--line); background: var(--panel); border-radius: 16px 16px 0 0; z-index: 2; }
.panel-head h2 { margin: 0; font-size: 17px; }
.btn.ghost.dark { color: var(--ink-soft); border-color: var(--line); }
.btn.ghost.dark:hover { border-color: var(--accent); color: var(--accent); }
.panel-add, .panel-hint, .st-hostpicker, .st-list { max-width: 1340px; margin-left: auto; margin-right: auto; }
.panel-add { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 20px 6px; }
.panel-add input { flex: 1; min-width: 130px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.panel-hint { padding: 0 20px 10px; margin: 0; font-size: 12px; color: var(--ink-faint); }
.st-list { padding: 6px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.st-card { border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; box-shadow: var(--shadow-sm); }
.st-card.off { opacity: .6; }
.st-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.st-name { font-weight: 650; font-size: 14.5px; }
.st-state { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-faint); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
.st-card:not(.off) .st-state { color: var(--ok); border-color: var(--ok); }
.st-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.st-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 8px; }
.st-ips { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--ink-soft); }
.st-ipedit { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.st-history { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.st-log { font-size: 12px; font-family: var(--mono); color: var(--ink-soft); }
.st-log.bad { color: var(--danger); }
.st-log-h { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-faint); margin-top: 6px; }
.st-hostedit { width: 150px; font-family: var(--mono); font-size: 12px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.st-vm { color: var(--ink); }
.st-live { font-size: 11px; color: var(--ink-faint); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.st-live.on { color: var(--ok); border-color: var(--ok); font-weight: 600; }
.st-hostpicker { padding: 0 20px 10px; font-size: 12px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.st-hosthint { color: var(--ink-faint); }
.st-hostchip { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 4px 11px; font-size: 12px; font-family: var(--mono); cursor: pointer; color: var(--ink-soft); transition: all .12s; }
.st-hostchip:hover { border-color: var(--accent); color: var(--accent); }

/* access-hours inputs in the Beam students panel */
.st-hours { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-faint); }
.st-time, .st-start, .st-end { font-family: var(--mono); font-size: 12px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); }
.st-ips .st-start, .st-ips .st-end { padding: 5px 7px; }

/* The footer stays visible below the remote screen in a VM session, on every size. */

/* ---------- auth / sign-in card (shared look) ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px;
  background:
    radial-gradient(1100px 480px at 50% -10%, rgba(91,91,214,.20), transparent 60%),
    radial-gradient(820px 460px at 50% 115%, rgba(74,74,194,.15), transparent 60%),
    var(--bg); }
.auth-card { width: 330px; max-width: 100%; background: var(--panel); border: 1px solid var(--line);
  border-radius: 22px; padding: 34px 26px 30px; box-shadow: 0 18px 50px rgba(27,27,43,.14); text-align: center; }
.auth-home { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); text-decoration: none; float: left; margin: 0 0 4px; }
.auth-home:hover { color: var(--accent); }
.auth-logo { position: relative; width: 64px; height: 64px; margin: 14px auto 16px; border-radius: 18px;
  background: linear-gradient(135deg, #6a6ae0, var(--accent) 60%, var(--accent-deep)); box-shadow: 0 10px 24px rgba(74,74,194,.35);
  display: grid; place-items: center; }
.auth-logo-mark { color: #fff; font-family: var(--mono); font-weight: 700; font-size: 29px; }
.auth-badge { position: absolute; right: -6px; bottom: -6px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; box-shadow: 0 2px 6px rgba(27,27,43,.12); }
.auth-title { margin: 0; font-size: 23px; font-weight: 700; letter-spacing: -.2px; }
.auth-spark { color: var(--accent); }
.auth-sub { margin: 6px 0 14px; color: var(--ink-soft); font-size: 13.5px; }
.auth-bar { display: flex; gap: 6px; justify-content: center; margin: 0 auto 18px; width: 72px; }
.auth-bar span { height: 4px; border-radius: 999px; flex: 1; background: var(--line); }
.auth-bar span:first-child { background: var(--accent); }
.auth-field { display: flex; align-items: center; gap: 9px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 0 13px; margin-bottom: 13px; transition: border-color .12s, box-shadow .12s; }
.auth-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,91,214,.12); }
.auth-ico { font-size: 14px; opacity: .55; flex: none; }
.auth-field input { flex: 1; border: 0; background: transparent; padding: 15px 0; font-size: 14px; outline: none; color: var(--ink); }
.btn.big { padding: 15px 16px; font-size: 15px; border-radius: 13px; }
.btn .arr { margin-left: 4px; }
.auth-alt { width: 100%; margin-top: 12px; border: 0; background: transparent; color: var(--ink-soft); font-size: 13px; cursor: pointer; padding: 9px; border-radius: 10px; }
.auth-alt:hover { background: rgba(91,91,214,.08); color: var(--accent); }
.auth-alt b { color: var(--accent); }
.ok-msg { color: #1f9d57; font-size: 13px; margin: 2px 0 6px; }
.auth-foot { margin-top: 18px; color: var(--ink-faint); font-size: 11.5px; }
@media (max-width: 440px) { .auth-card { padding: 24px 20px; border-radius: 20px; } }

.st-code { font-weight: 600; color: var(--accent); letter-spacing: .5px; }

.st-pw { width: 170px; font-size: 12px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }

.st-rebind { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.st-hostchip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft, rgba(91,91,214,.1)); font-weight: 600; }

/* ===== mobile session: radial icon menu + Mouse mode (ported from the student console) ===== */
#video, .stage { touch-action: none; -webkit-user-select: none; user-select: none; }
.kbd-proxy { position: fixed; top: -300px; left: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; font-size: 16px; }

/* main button: quiet glass disc, four dots that turn into a close mark */
.fab { width: 48px; height: 48px; border: 1px solid rgba(255,255,255,.18); background: rgba(14,16,22,.56);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.10) inset, 0 8px 22px rgba(0,0,0,.34); display: grid; place-items: center; }
.fab .fab-ico { display: block; position: absolute; width: 22px; height: 22px; transition: transform .22s cubic-bezier(.2,.9,.3,1.1), opacity .16s ease; }
.fab .fab-ico-close { opacity: 0; transform: rotate(-90deg) scale(.6); }
body.menu-open .fab { background: rgba(255,255,255,.94); border-color: transparent; color: #14161c; }
body.menu-open .fab .fab-ico-dots { opacity: 0; transform: rotate(90deg) scale(.6); }
body.menu-open .fab .fab-ico-close { opacity: 1; transform: none; }
.fab:active { transform: scale(.92); }
body.fab-hidden .fab { opacity: 0; transform: scale(.6); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }

/* edge handle to bring the hidden button back */
.fab-handle { display: none; position: fixed; z-index: 10; right: 0; top: 50%; transform: translateY(-50%);
  width: calc(22px + env(safe-area-inset-right, 0px)); height: 72px; padding: 0; border: 0; background: transparent; cursor: pointer;
  align-items: center; justify-content: flex-start; -webkit-tap-highlight-color: transparent; }
.fab-handle span { display: block; width: 4px; height: 40px; margin-left: 9px; border-radius: 999px; background: rgba(255,255,255,.5); box-shadow: 0 0 0 1px rgba(0,0,0,.22); }
body.touch.fab-hidden .fab-handle { display: flex; }

/* the menu is a full-screen layer; its round items sit on an arc */
.fab-menu, .fab-menu.opening, .fab-menu.closing { position: fixed; left: 0; top: 0; right: 0; bottom: 0; min-width: 0; padding: 0; border: 0;
  background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; opacity: 1; transform: none; pointer-events: none; border-radius: 0; }
.fab-menu[hidden] { display: none; }
.fab-item { position: fixed; width: 46px; height: 46px; padding: 0; gap: 0; border-radius: 50%; display: grid; place-items: center; pointer-events: auto;
  background: rgba(14,16,22,.56); border: 1px solid rgba(255,255,255,.22); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.10) inset, 0 6px 18px rgba(0,0,0,.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2);
  transition: transform .2s cubic-bezier(.2,.9,.3,1.15), opacity .16s ease, background .12s; -webkit-tap-highlight-color: transparent; }
.fab-item[hidden] { display: none; }
.fab-item svg { width: 22px; height: 22px; color: #fff; }
.fab-item span:not(.fab-badge) { display: none; }   /* icon-only; label is the tooltip */
.fab-item:active { transform: scale(.9); background: rgba(255,255,255,.26); }
.fab-item.on { background: #17a07a; border-color: transparent; }
.fab-item.danger { background: rgba(229,72,77,.82); border-color: transparent; }
.fab-menu.opening .fab-item, .fab-menu.closing .fab-item { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 0)) scale(.4); }
.fab-badge { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #fff; color: #14161c; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; }
.fab-badge:empty { display: none; }

/* instant local pointer (Mouse mode) */
.lcur { position: absolute; left: 0; top: 0; width: 20px; height: 20px; z-index: 6; pointer-events: none; opacity: 0; transition: opacity .25s ease; will-change: transform; }
.lcur svg { display: block; width: 20px; height: 20px; margin: -2px 0 0 -3px; filter: drop-shadow(0 0 1px rgba(0,0,0,.28)); }
.lcur.show { opacity: 1; transition: none; }

/* key bar above the phone keyboard */
.key-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 12; display: flex; gap: 6px; padding: 6px 8px;
  padding-left: calc(8px + env(safe-area-inset-left, 0px)); padding-right: calc(8px + env(safe-area-inset-right, 0px));
  background: rgba(24,26,38,.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; touch-action: pan-x; }
.key-bar::-webkit-scrollbar { display: none; }
.key-bar[hidden] { display: none; }
.kb-key { flex: 1 0 auto; min-width: 46px; height: 38px; padding: 0 10px; border: 0; border-radius: 9px; cursor: pointer; background: rgba(255,255,255,.12); color: #fff; font-size: 14px; font-weight: 600; -webkit-tap-highlight-color: transparent; }
.kb-key:active { background: rgba(255,255,255,.26); }
.kb-key.on { background: #17a07a; }
.kb-key.kb-hide { flex: 0 0 auto; background: transparent; color: #aeb4c6; }

/* clearer pull-tab for the hidden control button (obvious it is a button) */
.fab-handle { width: 34px; height: 50px; top: 50%; transform: translateY(-50%); right: 0; padding: 0;
  display: none; align-items: center; justify-content: center;
  background: rgba(16,18,28,.58); border: 1px solid rgba(255,255,255,.26); border-right: 0;
  border-radius: 25px 0 0 25px; -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2);
  box-shadow: 0 6px 18px rgba(0,0,0,.4); -webkit-tap-highlight-color: transparent; }
body.touch.fab-hidden .fab-handle { display: flex; }
.fab-handle:active { background: rgba(255,255,255,.3); }
.fab-handle span { display: block; width: 14px; height: 14px; margin: 0; border-radius: 0; box-shadow: none;
  background:
    radial-gradient(circle 2px at 4px 4px, #fff 96%, transparent 100%),
    radial-gradient(circle 2px at 10px 4px, #fff 96%, transparent 100%),
    radial-gradient(circle 2px at 4px 10px, #fff 96%, transparent 100%),
    radial-gradient(circle 2px at 10px 10px, #fff 96%, transparent 100%); }
/* a gentle one-time nudge so it is noticed, then it rests */
@keyframes fab-tab-in { 0% { transform: translate(14px,-50%); opacity: 0; } 100% { transform: translate(0,-50%); opacity: 1; } }
body.touch.fab-hidden .fab-handle { animation: fab-tab-in .5s cubic-bezier(.2,.9,.3,1.1) 1; }
@media (prefers-reduced-motion: reduce) { body.touch.fab-hidden .fab-handle { animation: none; } }
