:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f1f3f5;
  background: #0b0d0f;
  font-synthesis: none;
  --bg: #0b0d0f;
  --surface: #111316;
  --surface-raised: #171a1e;
  --surface-hover: #1d2126;
  --border: #292e34;
  --border-strong: #373e46;
  --text: #f1f3f5;
  --muted: #959da7;
  --faint: #676f79;
  --accent: #31c48d;
  --accent-dark: #0c694d;
  --accent-soft: rgba(49, 196, 141, 0.12);
  --warning: #f2b84b;
  --danger: #ee6262;
  --danger-soft: rgba(238, 98, 98, 0.12);
  --topbar-height: 64px;
  --sidebar-width: 304px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
}

body,
button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
input,
select,
summary,
.screen-box {
  outline: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
.screen-box:focus-visible {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

button {
  color: inherit;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: var(--topbar-height) minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
}

.topbar {
  position: relative;
  z-index: 20;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) auto;
  align-items: center;
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  height: 100%;
  padding: 0 18px;
  border-right: 1px solid var(--border);
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(49, 196, 141, 0.32);
  border-radius: 7px;
  color: var(--accent);
  background: var(--accent-soft);
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 680;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-label,
.topbar-session span,
.console-identity span,
.device-copy span,
.small-status {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-session {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 18px;
}

.topbar-session > div {
  min-width: 0;
}

.topbar-session strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 620;
  line-height: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 4px rgba(103, 111, 121, 0.1);
}

.status-dot[data-state="ready"],
.status-dot[data-state="connected"] {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.status-dot[data-state="working"] {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(242, 184, 75, 0.12);
}

.status-dot[data-state="error"] {
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: #dce1e5;
  background: var(--surface-raised);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.button:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  border-color: #4b545e;
  color: #fff;
  background: var(--surface-hover);
}

.button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.icon-button {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 0;
}

.icon-button[aria-pressed="true"] {
  border-color: rgba(238, 98, 98, 0.42);
  color: var(--danger);
  background: var(--danger-soft);
}

.icon-button .icon-off,
.icon-button[aria-pressed="true"] .icon-on {
  display: none;
}

.icon-button[aria-pressed="true"] .icon-off {
  display: block;
}

.icon-button.is-loading svg,
.button.is-loading svg {
  animation: spin 700ms linear infinite;
}

.danger-button {
  gap: 8px;
  height: 34px;
  margin-right: 16px;
  padding: 0 13px;
  border-color: rgba(238, 98, 98, 0.34);
  color: #ffb0b0;
  background: var(--danger-soft);
  font-size: 12px;
  font-weight: 620;
}

.danger-button:hover:not(:disabled) {
  border-color: var(--danger);
  color: #fff;
  background: #7d292d;
}

.danger-button svg {
  width: 15px;
  height: 15px;
}

.sidebar {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px 14px 14px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.sidebar-heading,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-heading {
  margin: 0 4px 13px;
}

.heading-actions {
  display: flex;
  gap: 6px;
}

.eyebrow {
  display: block;
  margin-bottom: 2px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 650;
  line-height: 14px;
  text-transform: uppercase;
}

h2 {
  font-size: 14px;
  font-weight: 650;
  line-height: 19px;
}

.target-summary {
  margin: 0 4px 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 16px;
}

.targets {
  display: grid;
  gap: 6px;
}

.target {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.target:hover:not(:disabled) {
  border-color: var(--border);
  background: var(--surface-hover);
}

.target.active {
  border-color: rgba(49, 196, 141, 0.32);
  background: var(--accent-soft);
}

.target:disabled {
  cursor: not-allowed;
}

.target:disabled .target-icon,
.target:disabled .target-copy {
  opacity: 0.56;
}

.target-icon,
.device-icon,
.console-icon {
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #20242a;
}

.target-icon {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.target-icon svg {
  width: 16px;
  height: 16px;
}

.target-state-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--faint);
}

.target[data-state="online"] .target-state-dot {
  background: var(--accent);
}

.target[data-state="locked"] .target-state-dot {
  background: var(--warning);
}

.target-copy {
  min-width: 0;
}

.target-copy strong,
.device-copy strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 620;
  line-height: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-copy span {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  line-height: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-action {
  display: grid;
  place-items: center;
  color: var(--faint);
}

.target-action svg {
  width: 15px;
  height: 15px;
}

.target[data-state="locked"] .target-action {
  color: var(--warning);
}

.target[data-state="locked"] .target-action svg,
.target[data-state="offline"] .target-action svg,
.target[data-state="disabled"] .target-action svg {
  display: none;
}

.target[data-state="locked"] .target-action::after {
  width: 15px;
  height: 15px;
  content: "";
  background: currentColor;
  mask: linear-gradient(#000 0 0);
  opacity: 0;
}

.empty-targets {
  padding: 18px 10px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.device-panel,
.network-panel {
  display: grid;
  gap: 10px;
  padding-top: 17px;
  border-top: 1px solid var(--border);
}

.device-panel {
  margin-top: 22px;
}

.network-panel {
  margin-top: 18px;
}

.section-heading {
  margin: 0 4px 1px;
}

.device-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 5px 4px;
}

.device-icon {
  width: 30px;
  height: 30px;
  border-radius: 5px;
}

.device-icon svg {
  width: 15px;
  height: 15px;
}

.device-copy {
  min-width: 0;
}

.network-row {
  grid-template-columns: 30px minmax(0, 1fr) auto;
}

.network-test-button {
  gap: 6px;
  height: 32px;
  min-width: 74px;
  padding: 0 10px;
  color: #dce1e5;
  font-size: 11px;
  font-weight: 620;
}

.network-test-button svg {
  width: 14px;
  height: 14px;
}

.small-status.ok {
  color: var(--accent);
}

.small-status.warning {
  color: var(--warning);
}

.small-status.error {
  color: var(--danger);
}

.switch {
  position: relative;
  display: block;
  flex: 0 0 30px;
  width: 30px;
  height: 18px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch > span:first-of-type {
  position: absolute;
  inset: 0;
  border: 1px solid #49515a;
  border-radius: 9px;
  background: #272c31;
  transition: background 120ms ease, border-color 120ms ease;
}

.switch > span:first-of-type::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #aab1b8;
  content: "";
  transition: transform 120ms ease, background 120ms ease;
}

.switch input:checked + span {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.switch input:checked + span::after {
  background: #fff;
  transform: translateX(12px);
}

.switch input:focus-visible + span {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

.select-field {
  display: grid;
  gap: 5px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 15px;
}

.select-field select,
.select-field input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 29px 0 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: #dce1e5;
  background: #0e1012;
  font-size: 11px;
}

.select-field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 14px, calc(100% - 10px) 14px;
  background-repeat: no-repeat;
  background-size: 4px 4px, 4px 4px;
}

.preview-wrap {
  position: relative;
  display: none;
  aspect-ratio: 16 / 9;
  margin: 3px 4px 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #050607;
}

.preview-wrap.visible {
  display: block;
}

#localPreview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-label {
  position: absolute;
  left: 7px;
  bottom: 7px;
  padding: 3px 6px;
  border-radius: 4px;
  color: #fff;
  background: rgba(5, 7, 9, 0.72);
  font-size: 9px;
  line-height: 13px;
}

.access-panel {
  margin-top: auto;
  padding-top: 16px;
}

.access-panel summary {
  display: grid;
  grid-template-columns: 18px 1fr 18px;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 8px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  list-style: none;
}

.access-panel summary::-webkit-details-marker {
  display: none;
}

.access-panel summary:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.access-panel summary svg {
  width: 14px;
  height: 14px;
}

.summary-chevron {
  transition: transform 140ms ease;
}

.access-panel[open] .summary-chevron {
  transform: rotate(90deg);
}

.token-field {
  margin-top: 8px;
}

.view-detail-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 4px 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0e1012;
}

.view-detail-option div {
  min-width: 0;
}

.view-detail-option strong,
.view-detail-option span {
  display: block;
}

.view-detail-option strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 650;
  line-height: 16px;
}

.view-detail-option div > span {
  color: var(--muted);
  font-size: 10px;
  line-height: 14px;
}

.console {
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr) 32px;
  min-width: 0;
  min-height: 0;
  background: #060708;
}

.console-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 0 12px 0 15px;
  border-bottom: 1px solid var(--border);
  background: #0e1012;
}

.console-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.console-identity > div {
  min-width: 0;
}

.console-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 5px;
}

.console-icon svg {
  width: 15px;
  height: 15px;
}

.console-identity strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 620;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.viewer-actions .icon-button {
  border-color: transparent;
  background: transparent;
}

.toolbar-divider {
  width: 1px;
  height: 22px;
  margin: 0 3px;
  background: var(--border);
}

.screen-box {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #030405;
  user-select: none;
}

.screen-box:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent);
}

#remoteScreen {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  background: #030405;
  object-fit: contain;
}

.employee-overlay {
  position: absolute;
  left: 50%;
  top: 18px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: calc(100% - 32px);
  transform: translateX(-50%);
  border: 0;
  padding: 0;
  color: #f7fbff;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  white-space: pre-wrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}

.employee-overlay[hidden] {
  display: none;
}

.employee-overlay-text {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}

.employee-overlay-close {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  color: currentColor;
  background: rgba(0, 0, 0, 0.28);
  font: 700 18px/1 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
}

.employee-overlay-close:hover {
  background: rgba(0, 0, 0, 0.45);
}

.admin-overlay-tools {
  position: absolute;
  right: 14px;
  bottom: 42px;
  z-index: 8;
  display: grid;
  justify-items: end;
  gap: 8px;
  pointer-events: auto;
}

.admin-overlay-tools[hidden] {
  display: none;
}

.admin-overlay-toggle,
.admin-overlay-primary,
.admin-overlay-secondary,
.admin-overlay-icon {
  min-height: 34px;
  border: 1px solid rgba(92, 111, 132, 0.82);
  border-radius: 7px;
  color: #f4f8fb;
  background: rgba(11, 15, 19, 0.9);
  cursor: pointer;
  font: inherit;
}

.admin-overlay-toggle {
  min-width: 68px;
  padding: 0 14px;
  border-color: rgba(49, 208, 131, 0.75);
  background: rgba(10, 124, 86, 0.92);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.34);
  font-weight: 760;
}

.admin-overlay-panel {
  display: none;
  width: min(340px, calc(100vw - 28px));
  padding: 12px;
  border: 1px solid rgba(72, 81, 90, 0.82);
  border-radius: 8px;
  background: rgba(8, 11, 14, 0.94);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
  gap: 10px;
}

.admin-overlay-tools[data-open="true"] .admin-overlay-panel {
  display: grid;
}

.admin-overlay-tools[data-open="true"] .admin-overlay-toggle {
  display: none;
}

.admin-overlay-head,
.admin-overlay-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-overlay-head strong {
  font-size: 13px;
}

.admin-overlay-icon {
  width: 32px;
  min-height: 32px;
  padding: 0;
}

.admin-overlay-wide,
.admin-overlay-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.admin-overlay-wide span,
.admin-overlay-grid span {
  color: #aeb9c5;
  font-size: 11px;
}

.admin-overlay-wide textarea,
.admin-overlay-grid input,
.admin-overlay-grid select {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(92, 111, 132, 0.72);
  border-radius: 7px;
  color: #f5f8fb;
  background: rgba(5, 8, 11, 0.88);
  padding: 7px 9px;
  outline: none;
}

.admin-overlay-wide textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.35;
}

.admin-overlay-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-overlay-primary,
.admin-overlay-secondary {
  flex: 1 1 0;
  padding: 0 12px;
}

.admin-overlay-primary {
  border-color: rgba(49, 208, 131, 0.72);
  background: rgba(10, 124, 86, 0.95);
}

.admin-overlay-secondary {
  background: rgba(23, 30, 38, 0.95);
}

.display-stats {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: none;
  width: min(292px, calc(100% - 24px));
  padding: 10px;
  border: 1px solid rgba(72, 81, 90, 0.78);
  border-radius: 7px;
  color: #dce1e5;
  background: rgba(7, 9, 11, 0.84);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
  pointer-events: auto;
}

body.stats-open .display-stats {
  display: grid;
  gap: 8px;
}

body.console-only.stats-open .display-stats {
  top: 8px;
  right: 8px;
  width: min(252px, calc(100% - 16px));
  padding: 8px;
  opacity: 0.72;
  transform: scale(0.94);
  transform-origin: top right;
  transition: opacity 120ms ease, transform 120ms ease;
}

body.console-only.stats-open .display-stats:hover,
body.console-only.stats-open .display-stats:focus-within {
  opacity: 1;
  transform: scale(1);
}

.display-stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.display-stats-head strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 680;
  line-height: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.display-stats-head span {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 10px;
  font-weight: 680;
  line-height: 14px;
  text-transform: uppercase;
}

.display-stats-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.stats-copy {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(72, 81, 90, 0.86);
  border-radius: 5px;
  color: #dce1e5;
  background: rgba(23, 26, 30, 0.92);
  cursor: pointer;
}

.stats-copy:hover {
  border-color: #65717d;
  color: #fff;
}

.stats-copy svg {
  width: 13px;
  height: 13px;
}

.display-stats dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 12px;
  margin: 0;
}

.display-stats dl div {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.display-stats dt,
.display-stats dd {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.display-stats dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  line-height: 13px;
  text-transform: uppercase;
}

.display-stats dd {
  color: var(--text);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 14px;
}

.perf-meter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding-top: 7px;
  border-top: 1px solid rgba(72, 81, 90, 0.66);
}

.perf-meter span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.display-stats .warning {
  color: var(--warning);
}

.display-stats .danger {
  color: var(--danger);
}

.display-stats-hint {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 14px;
}

.display-stats-hint.warning {
  color: var(--warning);
}

.display-stats-hint.danger {
  color: var(--danger);
}

.empty-state,
.connecting-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 24px;
  color: var(--muted);
  background: #070809;
  text-align: center;
  pointer-events: none;
}

.empty-state strong {
  margin-top: 7px;
  color: #d9dde1;
  font-size: 15px;
  font-weight: 620;
  line-height: 21px;
}

.empty-state > span:last-child {
  max-width: 360px;
  font-size: 12px;
  line-height: 18px;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--faint);
  background: var(--surface);
}

.empty-icon svg {
  width: 24px;
  height: 24px;
}

.connecting-state {
  z-index: 2;
  flex-direction: row;
  color: #cdd2d7;
  font-size: 12px;
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

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

.hidden {
  display: none !important;
}

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 0 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  background: #0e1012;
  font-size: 10px;
  line-height: 14px;
}

.status-group {
  display: flex;
  align-items: center;
  min-width: 0;
}

.status-group > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}

#iceState {
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-metric {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.status-metric.warning {
  color: var(--warning);
}

.status-metric.danger {
  color: var(--danger);
}

body.console-only {
  cursor: none;
}

body.console-only .screen-box,
body.console-only #remoteScreen {
  cursor: none;
}

body.details-hidden .display-stats,
body.details-hidden .statusbar {
  display: none;
}

body.admin-view,
body.admin-view .screen-box,
body.admin-view #remoteScreen {
  cursor: default;
}

body.admin-view .admin-overlay-tools,
body.admin-view .admin-overlay-tools * {
  cursor: auto;
}

body.admin-view .admin-overlay-toggle,
body.admin-view .admin-overlay-primary,
body.admin-view .admin-overlay-secondary,
body.admin-view .admin-overlay-icon {
  cursor: pointer;
}

body.console-only .app-shell {
  display: block;
  height: 100dvh;
}

body.console-only .topbar,
body.console-only .sidebar,
body.console-only .sidebar-scrim,
body.console-only .console-toolbar {
  display: none;
}

body.console-only .console {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 28px;
}

body.console-only.details-hidden .console {
  grid-template-rows: minmax(0, 1fr);
}

body.console-only .screen-box {
  grid-row: 1;
}

body.console-only .statusbar {
  grid-row: 2;
  border-top-color: rgba(41, 46, 52, 0.72);
  background: rgba(7, 8, 9, 0.84);
}

body.console-only .display-stats dl {
  gap: 4px 9px;
}

body.console-only .display-stats dl div {
  grid-template-columns: 47px minmax(0, 1fr);
  gap: 6px;
}

body.console-only .display-stats-hint {
  max-height: 28px;
  overflow: hidden;
}

body.fit-cover #remoteScreen {
  object-fit: cover;
}

.status-group > span + span::before {
  width: 1px;
  height: 11px;
  margin: 0 9px;
  background: var(--border-strong);
  content: "";
}

.status-group-right {
  justify-content: flex-end;
}

.status-group svg {
  width: 12px;
  height: 12px;
  color: var(--accent);
}

.mini-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
}

.mini-dot.connected {
  background: var(--accent);
}

.mini-dot.warning {
  background: var(--warning);
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 16px;
  bottom: 45px;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 9px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: #e8ebed;
  background: #191d21;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
  font-size: 11px;
  line-height: 16px;
  pointer-events: auto;
}

.toast::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.toast.error::before {
  background: var(--danger);
}

.toast button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.toast button:hover {
  color: #fff;
  background: var(--surface-hover);
}

.toast button svg {
  width: 13px;
  height: 13px;
}

.mobile-only,
.sidebar-scrim {
  display: none;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .brand-block {
    padding: 0 12px;
    border-right: 0;
  }

  .brand-mark {
    display: none;
  }

  .product-label,
  .topbar-session span {
    display: none;
  }

  .topbar-session {
    padding: 0 10px;
  }

  .topbar-session strong {
    max-width: 120px;
  }

  .danger-button {
    width: 34px;
    margin-right: 10px;
    padding: 0;
  }

  .danger-button span {
    display: none;
  }

  .mobile-only {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    z-index: 50;
    top: var(--topbar-height);
    bottom: 0;
    left: 0;
    width: min(var(--sidebar-width), calc(100vw - 42px));
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 40;
    inset: var(--topbar-height) 0 0;
    background: rgba(0, 0, 0, 0.62);
  }

  body.sidebar-open .sidebar-scrim {
    display: block;
  }

  .console {
    grid-column: 1;
  }
}

@media (max-width: 600px) {
  :root {
    --topbar-height: 56px;
  }

  .brand-block {
    gap: 8px;
  }

  .topbar-session {
    gap: 7px;
  }

  .topbar-session strong {
    max-width: 90px;
    font-size: 11px;
  }

  .console {
    grid-template-rows: 48px minmax(0, 1fr) 30px;
  }

  .console-toolbar {
    padding: 0 7px 0 10px;
  }

  .console-icon,
  #streamDetails,
  .toolbar-divider,
  #videoState,
  #audioState,
  #bufferState,
  #bitrateState,
  #lossState,
  #transportState {
    display: none;
  }

  .viewer-actions {
    gap: 1px;
  }

  .viewer-actions .icon-button {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
  }

  .statusbar {
    padding: 0 9px;
  }

  #iceState {
    max-width: 145px;
  }

  .status-group > span + span::before {
    margin: 0 6px;
  }

  .empty-state > span:last-child {
    max-width: 260px;
  }
}

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