:root {
  --bg: #f5f5f8; --panel: #ffffff; --line: #e7e7ee;
  --ink: #1b1b2b; --ink-soft: #5c5c70; --ink-faint: #9a9aae;
  --accent: #5b5bd6; --accent-deep: #4a4ac2; --accent-soft: #eef0fd;
  --danger: #d6554b; --stage: #0e1116;
  --font: "Inter", "Segoe UI", system-ui, 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);
}
* { 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; }

.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 11px; padding: 9px 14px; cursor: pointer; transition: all .12s; box-shadow: var(--shadow); }
.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; box-shadow: none; }
.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: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.login-box { width: 340px; 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: 15px; 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: 8px 0 0; font-size: 21px; }
.login-box .muted { margin: 0 0 10px; font-size: 13px; }
.login-box input { padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); }
.login-foot { position: fixed; bottom: 16px; left: 0; right: 0; text-align: center; color: var(--ink-faint); font-size: 11.5px; }

/* ---------- console: the remote computer fills the whole screen ---------- */
.console { position: fixed; inset: 0; background: var(--stage); }
.stage { position: absolute; inset: 0; overflow: hidden; background: var(--stage);
  display: grid; place-items: center; }
/* pinned to the stage box: a grid/auto-sized video grows to its own 16:9 height on wide phones and loses the bottom (taskbar) */
#video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; display: block; background: var(--stage); }
.stage.controlling #video { cursor: none; }

/* ---------- floating control button (like AnyDesk / RustDesk) ---------- */
.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));
  display: grid; place-items: center; color: #fff; touch-action: none;
  background: rgba(40,42,70,.70); backdrop-filter: blur(8px); box-shadow: 0 6px 20px rgba(0,0,0,.4);
  transition: background .15s, transform .12s;
}
.fab:active { transform: scale(.94); }
.fab svg { width: 24px; height: 24px; }
body.menu-open .fab { background: var(--accent); }

/* the icon menu that opens from the button — white sheet */
.fab-menu {
  position: fixed; z-index: 11; min-width: 214px;
  right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  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);
  transform-origin: bottom right; transition: opacity .14s ease, transform .14s ease;
}
.fab-menu[hidden] { display: none; }
.fab-menu.closing, .fab-menu.opening { 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-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 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; }

/* multi-monitor selector chips inside the menu */
.mon-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 8px 8px; }
.mon-bar[hidden] { display: none; }
.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; }
.mon-chip.on { background: var(--accent, #6366f1); border-color: transparent; color: #fff; }
.btn.tiny { padding: 5px 11px; font-size: 12px; border-radius: 9px; }

.stat { position: absolute; bottom: 12px; right: 14px; z-index: 7; font-family: var(--mono); font-size: 11px; color: #cfd8e3; background: rgba(0,0,0,.45); padding: 3px 8px; border-radius: 6px; }

/* waiting / not-connected overlay */
.empty { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: #a9b4c0; padding: 24px; gap: 10px; background: var(--stage); }
.empty .logo-lg.small { width: 46px; height: 46px; font-size: 21px; border-radius: 13px; margin-bottom: 4px; }
.empty h3 { color: #e9edf3; margin: 0; font-size: 18px; }
.empty p { margin: 0; font-size: 13.5px; line-height: 1.6; max-width: 360px; }
.empty .btn { margin-top: 8px; }

/* one-tap overlay (only iOS Safari when autoplay is blocked) */
.tap-hint { position: absolute; inset: 0; z-index: 7; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 14, 22, 0.55); backdrop-filter: blur(2px); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tap-hint-inner { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 14px;
  background: var(--accent, #6366f1); color: #fff; font-size: 16px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.tap-hint-ico { font-size: 14px; }

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

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

/* ---------- touch / mobile control ---------- */
#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; }
@media (max-width: 640px) {
  .empty h3 { font-size: 16px; }
}

/* ---------- full-screen prompt (touch devices) ---------- */
.fs-hint { position: absolute; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 9;
  display: flex; justify-content: center; pointer-events: none; }
.fs-hint[hidden] { display: none; }
.fs-card { pointer-events: auto; display: flex; align-items: center; gap: 4px; padding: 6px;
  background: rgba(20,22,34,.86); backdrop-filter: blur(8px); border-radius: 999px; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.fs-go { border: 0; cursor: pointer; padding: 12px 20px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; }
.fs-skip { border: 0; cursor: pointer; padding: 12px 14px; border-radius: 999px; background: transparent; color: #c9cede; font-size: 13.5px; }
/* true full screen / installed app: pure black edges, like a native remote app */
:fullscreen .stage, :fullscreen #video, :fullscreen .console { background: #000; }
@media (display-mode: fullscreen), (display-mode: standalone) { .stage, #video, .console { background: #000; } }

/* ---------- key bar on top of 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); 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: var(--accent); }
.kb-key.kb-hide { flex: 0 0 auto; background: transparent; color: #aeb4c6; }
.stage { transition: transform .16s ease; }

/* ---------- controls stay hidden on phones until wanted ---------- */
.fab { transition: background .15s, transform .18s ease, opacity .18s ease; }
body.fab-hidden .fab { opacity: 0; transform: scale(.6); pointer-events: none; }
/* slim handle on the right edge — tap it (or tap with three fingers) to bring the controls 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: 5px; height: 44px; margin-left: 9px; border-radius: 999px;
  background: rgba(255,255,255,.55); box-shadow: 0 0 0 1px rgba(0,0,0,.28); }
body.touch.fab-hidden .fab-handle { display: flex; }

/* ---------- see-through menu (dark glass, white text) ---------- */
.fab-menu { background: rgba(16,18,28,.42); border: 1px solid rgba(255,255,255,.16);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 12px 36px rgba(0,0,0,.35); }
.fab-status { color: rgba(255,255,255,.78); }
.fab-item { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.45); }
.fab-item svg { color: rgba(255,255,255,.85); }
.fab-item:hover, .fab-item:active { background: rgba(255,255,255,.16); }
.fab-item.danger, .fab-item.danger svg { color: #ff8a80; }
.fab-item.on { background: rgba(255,255,255,.20); color: #fff; }
.fab-item.on svg { color: #fff; }
.mon-chip { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.22); color: #fff; }

/* ---------- icon-only radial menu: round glass buttons on an arc around the main button ---------- */
.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; }
.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(16,18,28,.46); border: 1px solid rgba(255,255,255,.24); color: #fff; text-shadow: none;
  -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2); box-shadow: 0 6px 18px rgba(0,0,0,.32);
  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:hover, .fab-item:active { background: rgba(255,255,255,.26); }
.fab-item.on { background: var(--accent); border-color: transparent; }
.fab-item.danger { background: rgba(190,40,40,.55); }
.fab-item.danger svg { color: #fff; }
.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: #1b1b2b; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; }
.fab-badge:empty { display: none; }
.fab-status { position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); pointer-events: none;
  padding: 6px 12px; border-radius: 999px; white-space: nowrap; background: rgba(16,18,28,.46); border: 1px solid rgba(255,255,255,.18);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #fff; font-size: 12px; transition: opacity .16s ease; }
.fab-menu.opening .fab-status, .fab-menu.closing .fab-status { opacity: 0; }

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

/* =====================================================================
   Session chrome, redesigned as a native mobile app.
   One idea: the remote computer IS the screen. Everything of ours is
   dark glass that floats, speaks in the phone's own system font, and
   gets out of the way. One accent (Elefair green) marks what is ON.
   ===================================================================== */
.console, .sheet-wrap, .toast, .key-bar { --glass: rgba(14,16,22,.56); --glass-solid: rgba(24,26,34,.94); --hair: rgba(255,255,255,.16);
  --on: #17a07a; --danger: #e5484d;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }
.console, .stage { overscroll-behavior: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }

/* nothing technical on screen: no connection read-out for students */
.fab-status, .stat { display: none !important; }

/* main button: a quiet glass disc — four dots that turn into a close mark */
.fab { width: 48px; height: 48px; border: 1px solid var(--hair); background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 1px 0 rgba(255,255,255,.10) inset, 0 8px 22px rgba(0,0,0,.34); color: #fff; }
.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; box-shadow: 0 8px 22px rgba(0,0,0,.34); }
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); }

/* fan buttons share the same glass; green = on, red = leave */
.fab-item { background: var(--glass); border: 1px solid var(--hair); box-shadow: 0 1px 0 rgba(255,255,255,.10) inset, 0 6px 18px rgba(0,0,0,.30); }
.fab-item:active { transform: scale(.9); background: rgba(255,255,255,.24); }
.fab-item.on { background: var(--on); border-color: transparent; }
.fab-item.danger { background: rgba(229,72,77,.82); border-color: transparent; }
.fab-handle span { width: 4px; height: 40px; background: rgba(255,255,255,.5); box-shadow: 0 0 0 1px rgba(0,0,0,.22); }

/* snack-bar messages */
.toast { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); max-width: min(92vw, 440px); padding: 11px 18px; border-radius: 999px;
  background: var(--glass-solid); border: 1px solid var(--hair); color: #fff; font-size: 14px; line-height: 1.3; text-align: center;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 10px 28px rgba(0,0,0,.36); }

/* connecting screen */
.empty { background: #0b0d12; color: #9aa3b2; }
.empty h3 { color: #fff; font-size: 17px; font-weight: 600; letter-spacing: -.1px; }
.spin { width: 34px; height: 34px; margin-bottom: 8px; border-radius: 50%; border: 3px solid rgba(255,255,255,.14); border-top-color: #fff; animation: beam-spin .9s linear infinite; }
.empty:has(#retryBtn:not([hidden])) .spin { animation: none; border-top-color: rgba(255,255,255,.14); }
@keyframes beam-spin { to { transform: rotate(360deg); } }
.empty .btn.primary { background: #fff; border-color: #fff; color: #14161c; box-shadow: none; border-radius: 999px; padding: 11px 22px; font-weight: 600; }

/* full-screen prompt + key bar in the same language */
.fs-card { background: var(--glass-solid); border: 1px solid var(--hair); }
.fs-go { background: #fff; color: #14161c; }
.kb-key.on { background: var(--on); }

/* bottom sheets */
.sheet-wrap { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; padding: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); background: rgba(0,0,0,.42); transition: background .18s ease; touch-action: none; }
.sheet-wrap[hidden] { display: none; }
.sheet { width: min(100%, 560px); max-height: 100%; overflow: auto; padding: 8px 18px 16px; border-radius: 24px; color: #fff;
  background: var(--glass-solid); border: 1px solid var(--hair); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(0,0,0,.5); transition: transform .22s cubic-bezier(.2,.9,.3,1), opacity .18s ease; touch-action: pan-y; }
.sheet.small { width: min(100%, 380px); }
.sheet-wrap.opening { background: rgba(0,0,0,0); }
.sheet-wrap.opening .sheet { transform: translateY(28px); opacity: 0; }
.sheet-grab { width: 36px; height: 4px; margin: 2px auto 10px; border-radius: 999px; background: rgba(255,255,255,.26); }
.sheet-title { margin: 0 0 10px; font-size: 18px; font-weight: 650; letter-spacing: -.2px; }
.sheet-text { margin: 0 0 14px; font-size: 14.5px; line-height: 1.45; color: #b9c0cd; }
.sheet-actions { display: flex; gap: 10px; }
.sheet-btn { flex: 1; height: 46px; padding: 0 16px; border: 0; border-radius: 14px; cursor: pointer; font-size: 15.5px; font-weight: 600;
  background: rgba(255,255,255,.12); color: #fff; -webkit-tap-highlight-color: transparent; }
.sheet-btn:active { transform: scale(.98); }
.sheet-btn.primary { width: 100%; background: #fff; color: #14161c; }
.sheet-btn.danger { background: var(--danger); }
.guide-rows { display: grid; grid-template-columns: 1fr; gap: 2px 18px; margin-bottom: 14px; }
.guide-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.guide-glyph { flex: none; width: 44px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; }
.guide-glyph svg { width: 34px; height: 24px; }
.guide-txt { display: flex; flex-direction: column; min-width: 0; }
.guide-txt b { font-size: 14.5px; font-weight: 600; }
.guide-txt i { font-style: normal; font-size: 13px; color: #a9b1bf; }
@media (orientation: landscape) { .guide-rows { grid-template-columns: 1fr 1fr; } .sheet-wrap { align-items: center; } }
@media (prefers-reduced-motion: reduce) { .sheet, .fab .fab-ico, .fab-item, .stage { transition: none !important; } .spin { animation-duration: 2.4s; } }

/* the spinner keeps turning while the page is retrying by itself; it only stops when there is nothing to wait for */
.empty:has(#retryBtn:not([hidden])) .spin { animation: beam-spin .9s linear infinite; border-top-color: #fff; }
.empty.stopped .spin { animation: none; border-top-color: rgba(255,255,255,.14); }

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