/* Beam — dashboard and stream view. Dark only. */

:root {
  --bg: #0b0f1a;
  --bg-2: #0f1424;
  --surface: #141a2c;
  --surface-2: #1a2136;
  --surface-3: #222a42;
  --border: #262f4a;
  --border-strong: #34405f;
  --text: #e7ebf5;
  --muted: #8f9abb;
  --faint: #5d6889;
  --accent: #7c9cff;
  --accent-2: #3ee0c5;
  --accent-ink: #0b0f1a;
  --danger: #ff6b7d;
  --warn: #ffc46b;
  --ok: #3ee0a0;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgb(0 0 0 / 35%);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgb(124 156 255 / 10%), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgb(62 224 197 / 7%), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 1.6rem;
}

h2 {
  font-size: 1.12rem;
}

h3 {
  font-size: 1rem;
}

p {
  margin: 0.4em 0;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-3);
  border: 1px solid var(--border);
  padding: 0.08em 0.4em;
  border-radius: 6px;
  white-space: nowrap;
}

[hidden] {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.86rem;
}

.center {
  text-align: center;
  justify-content: center;
}

.grow {
  flex: 1;
  min-width: 0;
}

.noscript {
  padding: 2rem;
  text-align: center;
}

/* ── icons ─────────────────────────────────────────────────────────────── */

.icon {
  display: inline-flex;
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

.icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-logo svg,
.auth-logo svg {
  stroke: none;
}

/* ── layout ────────────────────────────────────────────────────────────── */

.boot {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem max(1rem, env(safe-area-inset-right)) 0.7rem max(1rem, env(safe-area-inset-left));
  background: rgb(11 15 26 / 80%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  width: 28px;
  height: 28px;
}

.nav {
  display: flex;
  gap: 0.25rem;
  margin-left: 0.75rem;
}

.nav-link {
  color: var(--muted);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-weight: 550;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}

.nav-link.active {
  color: var(--text);
  background: var(--surface-3);
}

.topbar-spacer {
  flex: 1;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  max-width: 40vw;
}

.user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.85rem;
}

.avatar.sm {
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
}

.view {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.75rem max(1rem, env(safe-area-inset-right)) 3rem max(1rem, env(safe-area-inset-left));
}

.view.narrow {
  max-width: 480px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.card + .card {
  margin-top: 1rem;
}

.card.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 2rem 1.5rem;
}

.card.narrow {
  max-width: 460px;
  margin: 2rem auto;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.row.end {
  justify-content: flex-end;
}

.row > input {
  flex: 1;
  min-width: 0;
}

/* ── controls ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--surface-3);
  text-decoration: none;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:focus-visible,
.icon-btn:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8f7bff);
  border-color: transparent;
  color: #0a0d18;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #93adff, #a08fff);
}

.btn-danger {
  background: rgb(255 107 125 / 14%);
  border-color: rgb(255 107 125 / 40%);
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: rgb(255 107 125 / 22%);
}

.btn-sm {
  min-height: 32px;
  padding: 0.3rem 0.7rem;
  font-size: 0.88rem;
}

.btn-lg {
  min-height: 46px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn.busy {
  position: relative;
  color: transparent !important;
}

.btn.busy::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--text);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-primary.busy::after {
  border-color: #0a0d18;
  border-right-color: transparent;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn:hover:not(:disabled) {
  background: var(--surface-3);
  color: var(--text);
}

.icon-btn.danger:hover:not(:disabled) {
  color: var(--danger);
}

.icon-btn.busy .icon {
  opacity: 0.3;
}

input[type="text"],
select {
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

input[type="text"]::placeholder {
  color: var(--faint);
}

input[type="text"]:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgb(124 156 255 / 20%);
}

.label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.hint {
  color: var(--faint);
  font-size: 0.82rem;
  margin: 0;
}

.form-error {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgb(255 107 125 / 40%);
  border-radius: var(--radius-sm);
  background: rgb(255 107 125 / 10%);
  color: #ffb3bd;
  font-size: 0.9rem;
}

.notice {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  margin: 0.75rem 0;
  font-size: 0.9rem;
}

.notice-warn {
  border: 1px solid rgb(255 196 107 / 35%);
  background: rgb(255 196 107 / 9%);
  color: #ffd99c;
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--faint);
  font-size: 0.85rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.tag {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  vertical-align: 0.1em;
  background: var(--surface-3);
  color: var(--muted);
}

.tag-host {
  background: rgb(124 156 255 / 15%);
  color: var(--accent);
}

.tag-client {
  background: rgb(62 224 197 / 13%);
  color: var(--accent-2);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── sign in ───────────────────────────────────────────────────────────── */

.auth-card {
  margin-top: 6vh;
  padding: 2rem 1.75rem;
}

.auth-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
}

.auth-logo {
  width: 56px;
  height: 56px;
  margin-bottom: 0.4rem;
}

.auth-head h1 {
  font-size: 2rem;
}

/* ── hosts ─────────────────────────────────────────────────────────────── */

.host-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
}

.host-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}

.host-card.online:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.host-card.offline {
  opacity: 0.78;
}

.host-top {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}

.host-os {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--accent);
  font-size: 1.35rem;
}

.host-card.offline .host-os {
  color: var(--faint);
}

.host-meta {
  flex: 1;
  min-width: 0;
}

.host-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-tools {
  display: flex;
  margin: -0.35rem -0.4rem 0 0;
}

.host-tools .icon-btn {
  width: 32px;
  height: 32px;
}

.host-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
}

.host-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}

.dot-on {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgb(62 224 160 / 18%), 0 0 12px rgb(62 224 160 / 60%);
}

.dot-off {
  background: var(--faint);
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 2.5rem 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  text-align: center;
}

.empty-icon {
  width: 42px;
  height: 42px;
  color: var(--faint);
  margin-bottom: 0.5rem;
}

.get-started {
  margin-top: 1.5rem;
}

.get-started summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-weight: 650;
  list-style: none;
}

.get-started summary::-webkit-details-marker {
  display: none;
}

.get-started summary::after {
  content: "";
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s;
}

.get-started[open] summary::after {
  transform: rotate(-135deg);
}

.get-started summary .icon {
  color: var(--accent-2);
}

.steps {
  list-style: none;
  margin: 1.1rem 0 0.6rem;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.step {
  display: flex;
  gap: 0.85rem;
}

.step-n {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: rgb(124 156 255 / 15%);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.cmd {
  color: var(--accent-2);
  white-space: normal;
  word-break: break-word;
}

/* ── lists (settings, shares) ──────────────────────────────────────────── */

.item-list,
.share-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.item-list li,
.share-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--border);
}

.item-list li:first-child,
.share-list li:first-child {
  border-top: 0;
}

.item-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--muted);
}

/* ── link ──────────────────────────────────────────────────────────────── */

.link-card {
  margin-top: 4vh;
  padding: 1.75rem;
}

.link-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.link-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.link-card h1 {
  font-size: 1.45rem;
}

.code-input {
  font-family: var(--mono) !important;
  font-size: 1.6rem !important;
  letter-spacing: 0.15em;
  text-align: center;
  text-transform: uppercase;
  margin-top: 0.75rem;
}

.device-box {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 1.1rem 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.device-name {
  font-weight: 650;
  font-size: 1.05rem;
  word-break: break-word;
}

.code-pill {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.1rem 0.55rem;
  border-radius: 6px;
  background: var(--surface-3);
  font-family: var(--mono);
  letter-spacing: 0.1em;
}

.result-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0.5rem auto 1rem;
  border-radius: 50%;
  font-size: 1.6rem;
}

.result-icon.ok {
  background: rgb(62 224 160 / 14%);
  color: var(--ok);
}

.result-icon.no {
  background: rgb(255 107 125 / 14%);
  color: var(--danger);
}

.link-card .row.center {
  margin-top: 1.25rem;
}

/* ── modal ─────────────────────────────────────────────────────────────── */

.modal {
  width: min(460px, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 25px 60px rgb(0 0 0 / 55%);
}

.modal::backdrop {
  background: rgb(4 6 12 / 65%);
  backdrop-filter: blur(3px);
}

.modal-body {
  padding: 1.25rem;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.modal-head h2 {
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

/* ── toasts ────────────────────────────────────────────────────────────── */

.toasts {
  position: fixed;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 2rem);
  pointer-events: none;
}

.toast {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  animation: toast-in 0.2s ease-out;
  transition: opacity 0.3s, transform 0.3s;
}

.toast-success {
  border-color: rgb(62 224 160 / 40%);
}

.toast-error {
  border-color: rgb(255 107 125 / 50%);
  color: #ffc2ca;
}

.toast-out {
  opacity: 0;
  transform: translateY(6px);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ── stream page ───────────────────────────────────────────────────────── */

body.streaming {
  overflow: hidden;
  background: #000;
}

body.streaming .topbar {
  display: none;
}

.view.stream-view {
  position: fixed;
  inset: 0;
  max-width: none;
  padding: 0;
}

.stream-container {
  position: absolute;
  inset: 0;
  background: #000;
}

.stream-loading,
.stream-end {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  color: var(--muted);
  background:
    radial-gradient(800px 400px at 50% 0%, rgb(124 156 255 / 10%), transparent 70%),
    var(--bg);
}

.stream-end .card {
  width: 100%;
}

/* The WASM client's view (crates/beam-web/src/ui.rs). */

.beam-stream {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  font: 14px/1.4 var(--font);
  color: var(--text);
}

.beam-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  touch-action: none;
  outline: none;
  /* The host draws its cursor into the video; a local one would double it. */
  cursor: none;
}

.beam-handle {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 3;
  width: 64px;
  height: 14px;
  margin-left: -32px;
  padding: 0;
  border: 0;
  border-radius: 0 0 10px 10px;
  background: rgb(20 26 44 / 55%);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s;
}

.beam-handle::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 5px;
  height: 3px;
  border-radius: 2px;
  background: rgb(231 235 245 / 70%);
}

.beam-handle:hover {
  opacity: 1;
}

.beam-locked .beam-handle {
  display: none;
}

.beam-toolbar {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: calc(100% - 1rem);
  margin-top: 0.5rem;
  padding: 0.35rem 0.4rem 0.35rem 0.8rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 14px;
  background: rgb(14 18 32 / 82%);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgb(0 0 0 / 50%);
  transform: translate(-50%, calc(-100% - 1rem));
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
  pointer-events: none;
}

.beam-toolbar.beam-show {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.beam-tb-host {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 650;
  max-width: 14rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.beam-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--warn);
}

.beam-dot-connected {
  background: var(--ok);
  box-shadow: 0 0 8px rgb(62 224 160 / 70%);
}

.beam-tb-quick {
  margin-left: 0.4rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  white-space: nowrap;
}

.beam-tb-spacer {
  flex: 1;
  min-width: 0.4rem;
}

.beam-toolbar select {
  width: auto;
  min-height: 32px;
  padding: 0.2rem 0.4rem;
  border-radius: 8px;
  border-color: rgb(255 255 255 / 12%);
  background: rgb(255 255 255 / 5%);
  font-size: 0.82rem;
}

.beam-toolbar button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.beam-toolbar button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.beam-toolbar button:hover {
  background: rgb(255 255 255 / 8%);
  color: var(--text);
}

.beam-toolbar button.beam-on {
  background: rgb(124 156 255 / 20%);
  color: var(--accent);
}

.beam-toolbar button.beam-danger:hover {
  background: rgb(255 107 125 / 18%);
  color: var(--danger);
}

.beam-stats {
  position: absolute;
  top: 4rem;
  left: 0.75rem;
  z-index: 2;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 10px;
  background: rgb(0 0 0 / 62%);
  color: #cfd6ea;
  font: 12px/1.55 var(--mono);
  white-space: pre;
  pointer-events: none;
}

.beam-status {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  max-width: calc(100% - 2rem);
  padding: 0.85rem 1.2rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 12px;
  background: rgb(14 18 32 / 85%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.beam-spinner {
  width: 18px;
  height: 18px;
  flex: none;
  border: 2px solid rgb(255 255 255 / 15%);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.beam-no-spin .beam-spinner {
  display: none;
}

.beam-audio-hint {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  z-index: 3;
  padding: 0.5rem 1rem;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 999px;
  background: rgb(14 18 32 / 85%);
  color: var(--text);
  font: inherit;
  transform: translateX(-50%);
  cursor: pointer;
}

.beam-toast {
  position: absolute;
  bottom: 4rem;
  left: 50%;
  z-index: 3;
  max-width: calc(100% - 2rem);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgb(14 18 32 / 88%);
  border: 1px solid rgb(255 255 255 / 12%);
  transform: translateX(-50%);
  pointer-events: none;
  text-align: center;
}

/* ── small screens ─────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  body {
    font-size: 14.5px;
  }

  .topbar {
    gap: 0.5rem;
  }

  .nav {
    margin-left: 0.25rem;
  }

  .nav-link {
    padding: 0.35rem 0.6rem;
  }

  .user-name {
    display: none;
  }

  .view {
    padding-top: 1.25rem;
  }

  h1 {
    font-size: 1.35rem;
  }

  .host-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
  }

  .auth-card {
    margin-top: 2vh;
    padding: 1.5rem 1.25rem;
  }

  .beam-tb-quick,
  .beam-toolbar select[data-r="fps"] {
    display: none;
  }

  .beam-tb-host {
    max-width: 7rem;
  }

  .beam-toolbar button {
    width: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
