:root {
  color-scheme: dark;
  --bg: #0a0910;
  --bg-soft: #0e0d15;
  --panel: #13111c;
  --panel-2: #171521;
  --panel-3: #1c1929;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #f4f1fb;
  --muted: #918ca2;
  --muted-2: #6c6879;
  --primary: #8b5cf6;
  --primary-2: #a67bff;
  --primary-soft: rgba(139, 92, 246, 0.14);
  --cyan: #45d7e8;
  --green: #46d39a;
  --orange: #ffae57;
  --red: #ff647c;
  --sidebar: 244px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.26);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 58% -20%, rgba(104, 61, 190, 0.12), transparent 35rem),
    var(--bg);
  color: var(--text);
  font-size: 14px;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

svg {
  display: block;
}

.hidden {
  display: none !important;
}

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

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  padding: 24px;
  background:
    linear-gradient(rgba(10, 9, 16, 0.65), rgba(10, 9, 16, 0.96)),
    radial-gradient(circle at 50% 0, rgba(139, 92, 246, 0.18), transparent 35rem);
}

.login-glow {
  position: absolute;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.18;
  pointer-events: none;
}

.glow-a {
  background: #7c4dff;
  left: 10%;
  top: -15%;
}

.glow-b {
  background: #23c7d9;
  right: 10%;
  bottom: -20%;
}

.login-card {
  width: min(430px, 100%);
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  padding: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: rgba(19, 17, 28, 0.88);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(18px);
}

.login-card h1 {
  margin: 5px 0 8px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.login-copy > p:last-child {
  margin: 0;
}

.login-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.auth-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.auth-tab {
  min-height: 31px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.auth-tab.active {
  color: #fff;
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.16);
}

.login-card .field {
  margin-bottom: 0;
}

.auth-hint {
  margin: -5px 0 0;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.auth-hint code {
  color: #cfc4e4;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #fff;
  background: linear-gradient(145deg, #a779ff, #7046dc);
  box-shadow: 0 9px 24px rgba(139, 92, 246, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.brand-mark.large {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  font-size: 15px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--primary-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.form-error {
  min-height: 18px;
  margin: -10px 0 0;
  color: var(--red);
  font-size: 12px;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar);
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(12, 11, 18, 0.96);
}

.sidebar-head {
  height: 75px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.brand-copy {
  min-width: 0;
  display: grid;
}

.brand-copy strong {
  font-size: 14px;
  letter-spacing: -0.01em;
}

.brand-copy span {
  color: var(--muted);
  font-size: 10px;
}

.navigation {
  flex: 1;
  overflow-y: auto;
  padding: 14px 11px 20px;
}

.nav-label {
  margin: 19px 11px 8px;
  color: #5f5b6c;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.nav-label:first-child {
  margin-top: 6px;
}

.nav-item {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: #a7a2b3;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: 160ms ease;
}

.nav-item:hover {
  color: #eee9fa;
  background: rgba(255, 255, 255, 0.035);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.075));
  box-shadow: inset 2px 0 var(--primary);
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-count {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--primary-2);
  background: var(--primary-soft);
  font-size: 10px;
  font-weight: 800;
}

.status-dot {
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-radius: 50%;
  background: #3d3947;
}

.status-dot.active {
  background: var(--green);
  box-shadow: 0 0 9px rgba(70, 211, 154, 0.8);
}

.sidebar-foot {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 5px;
}

.account-chip > div:last-child {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.account-chip strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-chip span {
  color: var(--muted);
  font-size: 9px;
}

.account-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 9px;
  color: #e8dcff;
  background: var(--primary-soft);
  font-size: 9px;
  font-weight: 850;
}

.server-state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.server-state > div {
  display: grid;
  gap: 2px;
}

.server-state strong {
  font-size: 11px;
}

.server-state span:last-child {
  color: var(--muted);
  font-size: 9px;
}

.live-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--orange);
}

.live-dot.online {
  background: var(--green);
  box-shadow: 0 0 10px rgba(70, 211, 154, 0.65);
}

.main {
  min-height: 100vh;
  margin-left: var(--sidebar);
}

.topbar {
  min-height: 75px;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(20px, 3vw, 38px);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 9, 16, 0.84);
  backdrop-filter: blur(18px);
}

.title-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.title-area h1 {
  margin: 0 0 3px;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.title-area p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.scope-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scope-copy {
  display: grid;
  margin-right: 4px;
  text-align: right;
}

.scope-copy span {
  color: var(--muted);
  font-size: 9px;
}

.scope-copy strong {
  max-width: 160px;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content {
  width: min(1580px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 2.5vw, 34px);
}

.view {
  display: none;
  animation: view-in 180ms ease;
}

.view.active {
  display: block;
}

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.stat-card {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background:
    radial-gradient(circle at 110% -40%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 58%),
    var(--panel);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.13);
}

.stat-card.purple { --accent: var(--primary-2); }
.stat-card.cyan { --accent: var(--cyan); }
.stat-card.orange { --accent: var(--orange); }
.stat-card.green { --accent: var(--green); }

.stat-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 11px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.stat-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-card > div:last-child {
  min-width: 0;
  display: grid;
}

.stat-card span {
  color: var(--muted);
  font-size: 10px;
}

.stat-card strong {
  margin: 2px 0;
  font-size: 22px;
  line-height: 1;
}

.stat-card small {
  overflow: hidden;
  color: var(--muted-2);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.75fr);
  gap: 14px;
  margin-bottom: 14px;
}

.panel {
  min-width: 0;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(22, 20, 31, 0.98), rgba(17, 15, 25, 0.98));
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.12);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-head h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.head-actions,
.button-row,
.tool-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.quick-action {
  min-height: 65px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  text-align: left;
  transition: 150ms ease;
}

.quick-action:hover {
  transform: translateY(-1px);
  border-color: rgba(139, 92, 246, 0.32);
  background: rgba(139, 92, 246, 0.055);
}

.quick-action.danger-soft:hover {
  border-color: rgba(255, 100, 124, 0.35);
  background: rgba(255, 100, 124, 0.055);
}

.quick-action > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.quick-action strong {
  font-size: 11px;
}

.quick-action small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 800;
}

.quick-icon.violet { color: var(--primary-2); background: var(--primary-soft); }
.quick-icon.cyan { color: var(--cyan); background: rgba(69, 215, 232, 0.11); }
.quick-icon.orange { color: var(--orange); background: rgba(255, 174, 87, 0.11); }
.quick-icon.red { color: var(--red); background: rgba(255, 100, 124, 0.11); }

.button,
.icon-button,
.text-button {
  border: 0;
  cursor: pointer;
  transition: 150ms ease;
}

.button {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.07);
}

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

.button.primary {
  color: #fff;
  background: linear-gradient(145deg, #9768fb, #7546db);
  box-shadow: 0 9px 22px rgba(117, 70, 219, 0.2);
}

.button.secondary {
  color: #d8c7ff;
  background: var(--primary-soft);
}

.button.ghost {
  color: #b9b4c4;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.025);
}

.button.danger {
  color: #ffabb8;
  border: 1px solid rgba(255, 100, 124, 0.18);
  background: rgba(255, 100, 124, 0.1);
}

.button.small {
  min-height: 32px;
  padding: 0 11px;
  font-size: 10px;
}

.button.wide {
  width: 100%;
}

.button.grow,
.grow {
  flex: 1;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
}

.icon-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
}

.text-button {
  padding: 4px;
  color: var(--primary-2);
  background: transparent;
  font-size: 10px;
}

.scope-badge,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.scope-badge {
  min-height: 24px;
  padding: 0 9px;
  color: var(--primary-2);
  background: var(--primary-soft);
}

.pill {
  min-height: 25px;
  padding: 0 10px;
  color: var(--green);
  border: 1px solid rgba(70, 211, 154, 0.15);
  background: rgba(70, 211, 154, 0.1);
}

.pill.offline {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 10px;
}

.device-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.022);
}

.device-card.selected {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.06);
}

.device-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.device-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 10px;
  color: var(--primary-2);
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 900;
}

.device-name {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.device-name strong,
.table-device strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-name span,
.table-device span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-check {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.device-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.metric {
  display: grid;
  gap: 2px;
  padding: 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.027);
}

.metric span {
  color: var(--muted);
  font-size: 8px;
}

.metric strong {
  font-size: 10px;
}

.device-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
}

.online-label,
.offline-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 700;
}

.online-label::before,
.offline-label::before {
  width: 5px;
  height: 5px;
  content: "";
  border-radius: 50%;
  background: var(--green);
}

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

.offline-label::before {
  background: #55515f;
}

.activity-list {
  display: grid;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-bullet {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 8px;
  color: var(--primary-2);
  background: var(--primary-soft);
  font-size: 10px;
  font-weight: 800;
}

.activity-content {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.activity-content strong {
  overflow: hidden;
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-content span {
  color: var(--muted);
  font-size: 8px;
}

.compact-list {
  max-height: 160px;
  overflow: auto;
}

.full-list .activity-item {
  padding: 13px 3px;
}

.empty-small {
  padding: 24px 0;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  padding: 44px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  padding: 30px 20px;
}

.empty-state h3 {
  margin: 9px 0 4px;
  color: #c9c4d3;
  font-size: 12px;
}

.empty-state p {
  max-width: 360px;
  margin: 0;
  font-size: 9px;
  line-height: 1.6;
}

.empty-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--primary-2);
  background: var(--primary-soft);
  font-size: 18px;
}

.select,
.field input,
.field textarea,
.search-box,
.terminal-input,
.input-action {
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: #100e18;
  outline: none;
}

.select {
  min-height: 39px;
  padding: 0 32px 0 11px;
  border-radius: 9px;
  cursor: pointer;
}

.select.compact {
  min-height: 32px;
  max-width: 185px;
  font-size: 10px;
}

.select:focus,
.field input:focus,
.field textarea:focus,
.search-box:focus-within,
.terminal-input:focus-within,
.input-action:focus-within {
  border-color: rgba(139, 92, 246, 0.56);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.08);
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #b8b2c2;
  font-size: 10px;
  font-weight: 650;
}

.field > span b {
  color: var(--primary-2);
  font-size: 9px;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 40px;
  padding: 10px 11px;
  border-radius: 9px;
  resize: vertical;
  font-size: 11px;
}

.field textarea {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  line-height: 1.5;
}

.search-box {
  height: 33px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 9px;
}

.search-box span {
  color: var(--muted);
}

.search-box input {
  width: min(240px, 35vw);
  border: 0;
  color: var(--text);
  background: transparent;
  outline: none;
  font-size: 10px;
}

.table-wrap {
  overflow: auto;
}

.device-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.device-table th {
  padding: 10px 9px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.device-table td {
  max-width: 220px;
  padding: 11px 9px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  color: #c5c0cd;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-table tr:hover td {
  background: rgba(255, 255, 255, 0.012);
}

.table-device {
  min-width: 150px;
  display: grid;
  gap: 2px;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
}

.mini-button {
  min-width: 27px;
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
}

.sync-layout {
  display: grid;
  grid-template-columns: minmax(310px, 0.7fr) minmax(0, 1.3fr);
  gap: 14px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.setting-row > div {
  display: grid;
  gap: 3px;
}

.setting-row strong {
  font-size: 10px;
}

.setting-row span {
  color: var(--muted);
  font-size: 8px;
}

.switch {
  width: 35px;
  height: 20px;
  position: relative;
  flex: none;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #2b2833;
  cursor: pointer;
  transition: 160ms ease;
}

.switch span::after {
  width: 14px;
  height: 14px;
  position: absolute;
  top: 3px;
  left: 3px;
  content: "";
  border-radius: 50%;
  background: #8a8594;
  transition: 160ms ease;
}

.switch input:checked + span {
  background: rgba(139, 92, 246, 0.45);
}

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

.range {
  width: 100%;
  accent-color: var(--primary);
}

.check-list {
  max-height: 170px;
  display: grid;
  gap: 6px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.1);
}

.check-list-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: 8px;
  color: #bdb8c7;
  background: rgba(255, 255, 255, 0.022);
  font-size: 10px;
}

.check-list-item small {
  margin-left: auto;
  color: var(--muted);
}

.help-text {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.6;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
}

input[type="checkbox"] {
  accent-color: var(--primary);
}

.sync-preview {
  min-height: 460px;
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) repeat(2, minmax(140px, 0.75fr));
  align-content: start;
  gap: 10px;
}

.preview-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #08070c;
}

.preview-card.master {
  grid-row: span 2;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  background: #121019;
}

.preview-head strong {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-head span {
  color: var(--muted);
  font-size: 8px;
}

.screen-frame {
  min-height: 220px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(255,255,255,.018) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.018) 75%),
    #09080d;
  background-size: 18px 18px;
}

.preview-card.master .screen-frame {
  min-height: 420px;
}

.screen-frame img {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  object-fit: contain;
}

.screen-placeholder {
  display: grid;
  place-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 8px;
}

.screen-placeholder span {
  font-size: 20px;
  opacity: 0.6;
}

.sync-event-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  font-size: 9px;
}

.pulse {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: #484451;
}

.pulse.active {
  background: var(--primary-2);
  box-shadow: 0 0 0 5px rgba(139, 92, 246, 0.1);
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  gap: 14px;
}

.clone-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
  gap: 14px;
}

.connect-card {
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
  padding: 14px;
  border: 1px solid rgba(82, 152, 255, 0.19);
  border-radius: 12px;
  background: linear-gradient(100deg, rgba(66, 133, 244, 0.09), rgba(139, 92, 246, 0.04));
}

.connect-card > div:nth-child(2) {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
}

.connect-card strong,
.dropbox-account strong {
  font-size: 11px;
}

.connect-card p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.connect-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 10px;
  color: #8bb8ff;
  background: rgba(66, 133, 244, 0.14);
  font-size: 13px;
  font-weight: 900;
}

.connect-icon.connected {
  color: #8bc1ff;
  background: rgba(82, 152, 255, 0.13);
}

.dropbox-account {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.022);
}

.dropbox-account > div:nth-child(2) {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.dropbox-account span:not(.scope-badge) {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.apk-only-note {
  margin: 12px 0 14px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.apk-only-note code {
  color: var(--text);
}

.upload-box {
  display: flex;
  align-items: stretch;
  gap: 9px;
  margin-bottom: 9px;
}

.upload-picker {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
  padding: 10px 13px;
  border: 1px dashed rgba(139, 92, 246, 0.3);
  border-radius: 11px;
  background: rgba(139, 92, 246, 0.035);
  cursor: pointer;
}

.upload-picker:hover {
  border-color: rgba(139, 92, 246, 0.56);
  background: rgba(139, 92, 246, 0.06);
}

.upload-picker > strong {
  display: grid;
  font-size: 10px;
}

.upload-picker small {
  margin-left: auto;
  color: var(--muted);
  font-size: 8px;
  text-align: right;
}

.upload-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 8px;
  color: var(--primary-2);
  background: var(--primary-soft);
  font-size: 15px;
  font-weight: 800;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.progress-row > span {
  height: 5px;
  flex: 1;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
}

.progress-row i {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  transition: width 180ms ease;
}

.progress-row small {
  min-width: 90px;
  color: var(--muted);
  font-size: 8px;
  text-align: right;
}

.clone-toolbar {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 14px 0 10px;
  padding: 7px 9px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.clone-toolbar > span {
  color: var(--muted);
  font-size: 9px;
}

.clone-toolbar-spacer {
  flex: 1;
}

.clone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 9px;
}

.clone-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.021);
  cursor: pointer;
  transition: 150ms ease;
}

.clone-card:hover {
  border-color: rgba(139, 92, 246, 0.25);
  background: rgba(139, 92, 246, 0.035);
}

.clone-card.selected {
  border-color: rgba(139, 92, 246, 0.42);
  background: rgba(139, 92, 246, 0.065);
}

.clone-file-icon {
  width: 34px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--orange);
  background: rgba(255, 174, 87, 0.1);
  font-size: 9px;
  font-weight: 900;
}

.clone-card-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 3px;
}

.clone-card-copy strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clone-card-copy span {
  color: var(--muted);
  font-size: 8px;
}

.clone-card input {
  align-self: start;
  accent-color: var(--primary);
}

.install-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.022);
}

.install-summary span {
  color: var(--muted);
  font-size: 9px;
}

.install-summary strong {
  overflow: hidden;
  color: #d7cef0;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.install-progress-list {
  max-height: calc(100vh - 250px);
  display: grid;
  gap: 8px;
  overflow: auto;
}

.install-item {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.021);
}

.install-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.install-item-head strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.install-item-head span {
  color: var(--primary-2);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.install-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.install-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
}

.install-track i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
}

.settings-actions {
  margin-top: 15px;
}

.tool-actions {
  flex-wrap: wrap;
  padding: 3px 0 17px;
}

.tool-actions .button {
  flex: 1;
  min-width: 74px;
}

.input-action {
  display: flex;
  padding: 4px;
  border-radius: 9px;
}

.input-action input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  box-shadow: none !important;
}

.console {
  min-height: 520px;
  max-height: 68vh;
  margin: 0;
  padding: 15px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: #d7d1df;
  background:
    linear-gradient(rgba(7, 6, 10, 0.92), rgba(7, 6, 10, 0.92)),
    repeating-linear-gradient(0deg, transparent 0, transparent 20px, rgba(255,255,255,.015) 21px);
  font: 10px/1.65 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.console-muted {
  color: #5e5968;
}

.terminal-panel {
  min-height: calc(100vh - 145px);
}

.terminal-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 9px;
}

.terminal-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  margin-bottom: 8px;
}

.terminal-tab {
  min-height: 29px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  font-size: 9px;
  white-space: nowrap;
}

.terminal-tab.active {
  color: #e4d8ff;
  border-color: rgba(139, 92, 246, 0.35);
  background: var(--primary-soft);
}

.terminal-console {
  min-height: calc(100vh - 315px);
  max-height: calc(100vh - 315px);
  border-radius: 9px 9px 0 0;
}

.terminal-input {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 12px;
  border-top: 0;
  border-radius: 0 0 9px 9px;
}

.terminal-input > span {
  color: var(--primary-2);
  font-family: monospace;
  font-weight: 800;
}

.terminal-input input {
  min-width: 0;
  flex: 1;
  border: 0;
  color: var(--text);
  background: transparent;
  outline: none;
  font-family: monospace;
  font-size: 11px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dropbox-settings-panel {
  grid-column: span 2;
}

.settings-form {
  display: grid;
  gap: 13px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.settings-field-wide {
  grid-column: span 2;
}

.redirect-box {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid rgba(139, 92, 246, 0.18);
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.035);
}

.redirect-box > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.redirect-box code {
  overflow-wrap: anywhere;
  color: #d8caff;
  font-size: 10px;
}

.redirect-box small {
  color: var(--muted);
  font-size: 8px;
}

.info-list {
  display: grid;
}

.info-list > div {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}

.info-list > div:last-child {
  border-bottom: 0;
}

.info-list span {
  color: var(--muted);
}

.info-list code {
  max-width: 70%;
  overflow: hidden;
  color: #cfc4e4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setting-copy {
  margin: 0 0 17px;
  font-size: 10px;
  line-height: 1.7;
}

.session-info {
  margin-bottom: 14px;
}

.admin-note {
  margin: 14px 0 0;
  padding: 11px 12px;
  border: 1px solid rgba(139, 92, 246, 0.16);
  border-radius: 9px;
  color: #c7b5ec;
  background: var(--primary-soft);
  font-size: 10px;
  line-height: 1.6;
}

.ug-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(380px, 1.08fr);
  gap: 14px;
  align-items: start;
}

.ug-login-panel,
.ug-control-panel {
  min-width: 0;
}

.code-input {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  color: #ddd8e8;
  background: #0c0b12;
  font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.code-input.tall {
  min-height: 178px;
}

.code-input:focus {
  border-color: rgba(139, 92, 246, 0.75);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.ug-match-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.ug-match-head strong {
  font-size: 13px;
}

.ug-match-status {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.018);
  font-size: 11px;
  line-height: 1.45;
}

.ug-match-status.ready {
  border-color: rgba(70, 211, 154, 0.24);
  color: #a9efd2;
  background: rgba(70, 211, 154, 0.055);
}

.ug-match-status.error {
  border-color: rgba(255, 100, 124, 0.24);
  color: #ff9aac;
  background: rgba(255, 100, 124, 0.055);
}

.ug-remember {
  margin: 12px 0 2px;
  color: var(--muted);
  font-size: 11px;
}

.ug-stream-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ug-remote-stage {
  min-height: 390px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-top: 15px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 20%, rgba(139, 92, 246, 0.08), transparent 55%),
    #08070c;
}

.ug-remote-stage canvas {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 610px;
  position: relative;
  z-index: 2;
  background: #000;
  touch-action: none;
}

.ug-bd-mount {
  width: min(100%, 420px);
  height: min(70vh, 610px);
  min-height: 390px;
  position: relative;
  z-index: 2;
  overflow: hidden;
  background: #000;
}

.ug-bd-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #000;
}

.ug-follower-frames {
  width: 2px;
  height: 2px;
  position: fixed;
  top: 0;
  left: -10000px;
  overflow: hidden;
  opacity: 0.01;
  pointer-events: none;
}

.ug-follower-frames .ug-bd-frame.follower {
  width: 240px;
  height: 426px;
}

.ug-remote-empty {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.ug-remote-empty strong {
  color: #d8d3df;
  font-size: 13px;
}

.ug-remote-empty span {
  font-size: 11px;
}

.ug-key-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.ug-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.ug-stats > div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
}

.ug-stats span {
  color: var(--muted-2);
  font-size: 9px;
}

.ug-stats strong {
  overflow: hidden;
  color: #ddd8e8;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.ug-account-layout {
  grid-template-columns: minmax(340px, 0.88fr) minmax(430px, 1.12fr);
}

.ug-session-toolbar,
.ug-device-toolbar,
.ug-subpanel-head,
.ug-selection-summary,
.ug-group-card,
.ug-session-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ug-session-toolbar {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.ug-session-toolbar > div,
.ug-session-card-main,
.ug-group-card > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ug-session-toolbar strong,
.ug-subpanel-head strong,
.ug-session-card strong,
.ug-group-card strong {
  color: #e2ddea;
  font-size: 12px;
}

.ug-session-toolbar small,
.ug-session-card small,
.ug-group-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ug-session-list,
.ug-group-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.ug-session-card,
.ug-group-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}

.ug-session-card.error {
  border-color: rgba(255, 100, 124, 0.26);
  background: rgba(255, 100, 124, 0.045);
}

.ug-session-card-main {
  flex: 1 1 auto;
}

.ug-session-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.ug-device-toolbar {
  flex-wrap: wrap;
  margin-bottom: 9px;
}

.ug-device-toolbar .grow {
  min-width: 190px;
  flex: 1 1 240px;
}

.ug-selection-summary {
  align-items: flex-start;
  margin-bottom: 10px;
  color: var(--muted-2);
  font-size: 9px;
}

.ug-selection-summary span:last-child {
  max-width: 70%;
  color: var(--muted);
  text-align: right;
}

.ug-device-list {
  max-height: 360px;
  overflow: auto;
  padding-right: 3px;
}

.ug-device-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
}

.ug-device-row + .ug-device-row {
  margin-top: 7px;
}

.ug-device-row:hover {
  border-color: rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.045);
}

.ug-device-row > span:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ug-device-row strong {
  overflow: hidden;
  color: #e4dfea;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ug-device-row small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ug-device-meta {
  min-width: 0;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.ug-device-meta code {
  max-width: 115px;
  overflow: hidden;
  color: #aa9fbc;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button.mini {
  width: 25px;
  height: 25px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
}

.ug-subpanel {
  margin-top: 15px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.012);
}

.ug-subpanel-head {
  margin-bottom: 11px;
}

.ug-subpanel-head .eyebrow {
  margin-bottom: 3px;
}

.ug-group-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.ug-group-create input {
  min-width: 0;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: none;
  color: #ddd8e8;
  background: #0c0b12;
  font-size: 10px;
}

.ug-group-create input:focus {
  border-color: rgba(139, 92, 246, 0.75);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.ug-scope-grid {
  margin-bottom: 8px;
}

.ug-scope-preview {
  display: grid;
  gap: 3px;
  margin: 8px 0 11px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.015);
  font-size: 9px;
  line-height: 1.5;
}

.ug-scope-preview strong {
  color: #ddd8e8;
  font-size: 11px;
}


.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 2, 6, 0.72);
  backdrop-filter: blur(6px);
}

.modal-card {
  width: min(420px, 100%);
  position: relative;
  z-index: 1;
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--panel-2);
  box-shadow: var(--shadow);
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: grid;
  gap: 8px;
}

.toast {
  min-width: 240px;
  max-width: 380px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: #d8d3df;
  background: #191621;
  box-shadow: var(--shadow);
  font-size: 10px;
  animation: toast-in 180ms ease;
}

.toast.success { border-color: rgba(70, 211, 154, 0.24); }
.toast.error { border-color: rgba(255, 100, 124, 0.28); }

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

.mobile-only {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 1120px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sync-preview {
    grid-template-columns: minmax(190px, 1.1fr) minmax(130px, 0.75fr);
  }

  .scope-copy {
    display: none;
  }
}

@media (max-width: 880px) {
  .mobile-only {
    display: grid;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 190ms ease;
  }

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

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(0, 0, 0, 0.55);
  }

  .sidebar-backdrop.open {
    display: block;
  }

  .sidebar-head .icon-button {
    margin-left: auto;
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .scope-bar {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .scope-bar .select {
    max-width: none;
  }

  .dashboard-grid,
  .sync-layout,
  .tool-layout,
  .clone-layout,
  .settings-grid,
  .ug-layout {
    grid-template-columns: 1fr;
  }

  .dropbox-settings-panel {
    grid-column: span 1;
  }

  .sync-preview {
    min-height: 350px;
  }

  .preview-card.master {
    grid-row: span 1;
  }

  .preview-card.master .screen-frame {
    min-height: 360px;
  }
}

@media (max-width: 560px) {
  .content {
    padding: 15px;
  }

  .topbar {
    padding: 12px 15px;
  }

  .stats-grid,
  .quick-grid {
    grid-template-columns: 1fr;
  }

  .settings-form-grid {
    grid-template-columns: 1fr;
  }

  .ug-stream-options {
    grid-template-columns: 1fr 1fr;
  }

  .ug-session-card,
  .ug-group-card,
  .ug-selection-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .ug-session-actions {
    justify-content: flex-start;
  }

  .ug-group-create {
    grid-template-columns: 1fr;
  }

  .ug-selection-summary span:last-child {
    max-width: none;
    text-align: left;
  }

  .ug-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ug-remote-stage {
    min-height: 330px;
  }

  .settings-field-wide {
    grid-column: span 1;
  }

  .panel {
    padding: 15px;
  }

  .stack-mobile {
    align-items: stretch;
    flex-direction: column;
  }

  .grow-mobile,
  .grow-mobile .search-box,
  .grow-mobile .search-box input {
    width: 100%;
  }

  .sync-preview {
    grid-template-columns: 1fr;
  }

  .screen-frame,
  .preview-card.master .screen-frame {
    min-height: 330px;
  }

  .head-actions {
    flex-wrap: wrap;
  }

  .upload-box,
  .connect-card {
    align-items: stretch;
    flex-direction: column;
  }

  .clone-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .clone-toolbar-spacer {
    display: none;
  }

  .clone-toolbar .button {
    width: 100%;
  }

  .toast-stack {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }

  .login-card {
    padding: 26px 22px;
  }
}

/* v1.8.0 — unified UGPhone Control Center */
.control-hub-panel {
  margin-bottom: 22px;
}

.control-setup-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(180px, .8fr) minmax(180px, .8fr) minmax(220px, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.control-toggle {
  min-height: 46px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}

.control-main-actions {
  margin-bottom: 16px;
}

.control-focus-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, .65fr);
  gap: 16px;
  align-items: start;
}

.control-main-stage {
  min-height: 520px;
  max-height: 76vh;
}

.control-follower-column {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(5, 5, 10, .35);
}

.control-side-head,
.clone-target-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.control-side-head span {
  color: var(--muted);
  font-size: 12px;
}

.control-follower-monitor {
  display: grid;
  gap: 9px;
  max-height: 600px;
  overflow: auto;
}

.follower-monitor-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
}

.follower-monitor-card.connected {
  border-color: rgba(62, 216, 164, .35);
}

.follower-monitor-card.error {
  border-color: rgba(255, 91, 112, .45);
}

.follower-monitor-card strong,
.follower-monitor-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.follower-monitor-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.follower-monitor-card button {
  border: 0;
  border-radius: 8px;
  padding: 7px 9px;
  background: rgba(255, 91, 112, .14);
  color: #ff9eac;
  cursor: pointer;
}

.follower-thumb {
  width: 52px;
  height: 76px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: #050507;
  color: var(--muted);
}

.follower-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ug-control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.ug-control-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
  transition: border-color .18s ease, transform .18s ease;
}

.ug-control-card:hover {
  transform: translateY(-1px);
}

.ug-control-card.selected {
  border-color: rgba(152, 93, 255, .62);
  box-shadow: inset 0 0 0 1px rgba(152, 93, 255, .16);
}

.ug-control-card.main {
  border-color: rgba(62, 216, 164, .58);
}

.ug-control-card-head {
  display: flex;
  justify-content: space-between;
  gap: 9px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.ug-control-card-head div {
  min-width: 0;
}

.ug-control-card-head strong,
.ug-control-card-head span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ug-control-card-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.phone-preview {
  position: relative;
  width: min(100%, 184px);
  aspect-ratio: 9 / 16;
  margin: 0 auto 10px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.1);
  border-radius: 20px;
  background: #030306;
  box-shadow: 0 14px 28px rgba(0,0,0,.25);
}

.phone-preview.connected {
  border-color: rgba(62, 216, 164, .48);
}

.phone-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phone-live-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
  background: radial-gradient(circle at 50% 35%, rgba(139, 87, 255, .2), transparent 45%);
}

.phone-live-placeholder span {
  font-weight: 800;
  letter-spacing: .12em;
}

.phone-live-placeholder small {
  padding: 0 12px;
  color: var(--muted);
}

.phone-status {
  position: absolute;
  right: 7px;
  bottom: 7px;
  left: 7px;
  padding: 5px 7px;
  border-radius: 8px;
  background: rgba(7,7,11,.84);
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  backdrop-filter: blur(8px);
}

.phone-status.online {
  color: #75e7bd;
}

.ug-control-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 9px;
}

.ug-control-meta span {
  overflow: hidden;
  padding: 4px 6px;
  border-radius: 7px;
  background: rgba(255,255,255,.035);
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ug-card-actions {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.ug-card-actions button {
  min-width: 0;
  height: 31px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
  color: var(--text);
  cursor: pointer;
}

.ug-card-actions button:hover {
  border-color: rgba(152, 93, 255, .55);
  background: rgba(152, 93, 255, .12);
}

.inventory-summary,
.eligibility-summary,
.ug-master-note {
  margin-bottom: 13px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,.025);
  color: var(--muted);
  font-size: 12px;
}

.ug-inventory-table td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clone-target-panel {
  margin: 14px 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.02);
}

.clone-target-grid {
  grid-template-columns: minmax(180px, .7fr) minmax(180px, .7fr) minmax(260px, 1.3fr);
  margin-bottom: 10px;
}

.ug-master-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.ug-master-note strong {
  color: #78e7be;
}

@media (max-width: 1180px) {
  .control-setup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .control-focus-layout {
    grid-template-columns: 1fr;
  }
  .control-follower-monitor {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    max-height: none;
  }
}

@media (max-width: 720px) {
  .control-setup-grid,
  .clone-target-grid {
    grid-template-columns: 1fr;
  }
  .control-main-stage {
    min-height: 420px;
  }
  .ug-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .ug-control-card {
    padding: 9px;
  }
  .ug-card-actions {
    grid-template-columns: repeat(4, 1fr);
  }
  .phone-preview {
    border-radius: 14px;
  }
}

@media (max-width: 430px) {
  .ug-control-grid {
    grid-template-columns: 1fr;
  }
  .phone-preview {
    width: 190px;
  }
}
