:root {
  --bg: #07090f;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef2f8;
  --muted: #93a0b4;
  --faint: #5c6778;
  --accent: #4f8cff;
  --accent-2: #7c5cff;
  --success: #34d399;
  --danger: #f87171;
  --radius: 16px;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- background glows ---------- */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
.bg-glow-1 {
  width: 560px; height: 560px;
  top: -180px; left: 50%;
  transform: translateX(-70%);
  background: radial-gradient(circle, rgba(79, 140, 255, 0.16), transparent 70%);
}
.bg-glow-2 {
  width: 480px; height: 480px;
  bottom: -200px; right: -120px;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.12), transparent 70%);
}

.hidden { display: none !important; }

code, .mono { font-family: var(--mono); }

code {
  background: rgba(79, 140, 255, 0.12);
  color: #9dc0ff;
  padding: 0.1em 0.4em;
  border-radius: 6px;
  font-size: 0.85em;
}

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 0.8rem; }
.brand-icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px rgba(79, 140, 255, 0.35);
}
.brand-sm .brand-icon { width: 38px; height: 38px; border-radius: 11px; }
.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand-sm .brand-name { font-size: 0.95rem; }
.brand-sub { font-size: 0.75rem; color: var(--muted); margin-top: 1px; }

/* ---------- login ---------- */
.login-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 2rem;
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  animation: rise 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.login-lock {
  margin: 1.6rem 0 0.9rem;
  width: 68px; height: 68px;
  display: grid; place-items: center;
  border-radius: 18px;
  color: var(--accent);
  background: rgba(79, 140, 255, 0.1);
  border: 1px solid rgba(79, 140, 255, 0.25);
}

.login-title { font-size: 1.3rem; font-weight: 700; margin: 0 0 0.4rem; letter-spacing: -0.02em; }
.login-hint { color: var(--muted); font-size: 0.9rem; line-height: 1.5; margin: 0 0 1.5rem; }

.login-footer { margin-top: 1.4rem; font-size: 0.75rem; color: var(--muted); opacity: 0.7; }

/* ---------- inputs & buttons ---------- */
.field { position: relative; margin-bottom: 1rem; }

.input {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.18);
}
.input-lg { padding: 0.9rem 2.8rem 0.9rem 1.1rem; font-size: 1rem; }
.input.mono { font-family: var(--mono); font-size: 0.85rem; }

.field-eye {
  position: absolute;
  right: 0.6rem; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 8px;
}
.field-eye:hover { color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border: none;
  border-radius: 11px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s, background 0.15s, box-shadow 0.15s, border-color 0.15s;
  user-select: none;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 6px 20px rgba(79, 140, 255, 0.3);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 26px rgba(79, 140, 255, 0.45); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-outline:hover { background: var(--surface-2); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }

.btn-lg { padding: 0.9rem 1.4rem; font-size: 0.98rem; }
.btn-sm { padding: 0.45rem 0.8rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin: 0.75rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ---------- admin layout ---------- */
.admin { position: relative; z-index: 1; min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 9, 15, 0.7);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-right { display: flex; align-items: center; gap: 0.6rem; }

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
}
.status-text { font-size: 0.8rem; color: var(--muted); margin-right: 0.5rem; }

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ---------- stepper ---------- */
.stepper {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.75rem;
  padding: 0 0.5rem;
}

.step { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; width: 110px; }

.step-num {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  border: 2px solid var(--border-strong);
  color: var(--muted);
  background: var(--surface);
  transition: all 0.25s;
}

.step-label { font-size: 0.76rem; color: var(--muted); font-weight: 500; text-align: center; }

.step-line {
  flex: 1;
  height: 2px;
  margin-top: 18px;
  background: var(--border-strong);
  border-radius: 2px;
  transition: background 0.25s;
}

.step.active .step-num {
  border-color: var(--accent);
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 5px rgba(79, 140, 255, 0.15);
}
.step.active .step-label { color: var(--text); }

.step.done .step-num {
  border-color: var(--success);
  color: var(--success);
  background: rgba(52, 211, 153, 0.08);
}
.step.done .step-label { color: var(--success); }
.step-line.done { background: var(--success); }

/* ---------- cards ---------- */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.018));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  animation: rise 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-head { display: flex; gap: 0.9rem; align-items: flex-start; margin-bottom: 1.25rem; }
.card-head h2 { margin: 0; font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.card-head p { margin: 0.3rem 0 0; font-size: 0.85rem; color: var(--muted); line-height: 1.5; }

.card-icon {
  flex-shrink: 0;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
}
.icon-blue { color: #7fb1ff; background: rgba(79, 140, 255, 0.12); border: 1px solid rgba(79, 140, 255, 0.25); }
.icon-violet { color: #b39dff; background: rgba(124, 92, 255, 0.12); border: 1px solid rgba(124, 92, 255, 0.25); }
.icon-green { color: #6ee7b7; background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.25); }
.icon-slate { color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); }

/* ---------- dropzone ---------- */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: 14px;
  padding: 2.2rem 1.25rem 1.6rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  background: rgba(0, 0, 0, 0.18);
}
.dropzone:hover { border-color: rgba(79, 140, 255, 0.5); background: rgba(79, 140, 255, 0.04); }
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(79, 140, 255, 0.1);
  transform: scale(1.01);
}

.dz-icon { color: var(--accent); margin-bottom: 0.7rem; opacity: 0.9; }
.dz-title { font-weight: 600; font-size: 1rem; margin-bottom: 0.35rem; }
.dz-sub { color: var(--muted); font-size: 0.8rem; margin-bottom: 0.7rem; }
.dz-note { margin-top: 0.9rem; font-size: 0.74rem; color: var(--muted); opacity: 0.8; }

/* ---------- progress ---------- */
.progress { margin-top: 1rem; }
.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}
.progress-info span:first-child {
  max-width: 75%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.progress-track {
  height: 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.15s;
}

/* ---------- file chip ---------- */
.file-chip {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: 11px;
  background: rgba(52, 211, 153, 0.07);
  border: 1px solid rgba(52, 211, 153, 0.25);
  font-size: 0.84rem;
  color: var(--success);
  word-break: break-all;
}
.file-chip::before {
  content: "✓";
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.15);
  font-weight: 700;
  font-size: 0.75rem;
}

/* ---------- bundle preview ---------- */
.bundle-preview {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.25rem;
}
.bp-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.6rem;
  font-weight: 600;
}
.bundle-preview pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.83rem;
  line-height: 1.7;
  color: #b8c6da;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---------- link result ---------- */
.link-result { margin-top: 1.4rem; animation: rise 0.35s ease; }

.lr-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--success);
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 0.8rem;
}

.link-box { display: flex; gap: 0.6rem; }
.link-box .input { flex: 1; min-width: 0; }

.lr-actions { display: flex; gap: 0.6rem; margin-top: 0.8rem; flex-wrap: wrap; }

/* ---------- history ---------- */
.history-wrap { overflow-x: auto; }

.history { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.history th {
  text-align: left;
  padding: 0.55rem 0.6rem;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}
.history td {
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text);
  vertical-align: middle;
}
.history tr:last-child td { border-bottom: none; }
.history .mono-cell { font-family: var(--mono); font-size: 0.78rem; color: #9dc0ff; }
.history .muted-cell { color: var(--muted); font-size: 0.8rem; }
.history a { color: var(--accent); text-decoration: none; }
.history a:hover { text-decoration: underline; }

.dl-count {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
}

.icon-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 0.4rem;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: color 0.15s, background 0.15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }

.history-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1.5rem 0.5rem 0.75rem;
}

.history-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.history-pages {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
}
.history-page-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
}
.history-page-btn:hover { color: var(--text); border-color: var(--border-strong); }
.history-page-btn.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.history-meta {
  margin: 0.55rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ---------- toasts ---------- */
.toast-host {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 100;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.1rem;
  border-radius: 12px;
  background: rgba(20, 26, 38, 0.95);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px);
  font-size: 0.85rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: 340px;
}
.toast.success { border-color: rgba(52, 211, 153, 0.4); }
.toast.error { border-color: rgba(248, 113, 113, 0.4); }
.toast .t-icon { flex-shrink: 0; }
.toast.success .t-icon { color: var(--success); }
.toast.error .t-icon { color: var(--danger); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.toast.out { opacity: 0; transform: translateY(6px); transition: all 0.25s; }

/* ---------- victims ---------- */
.victim-stats { margin-left: auto; display: flex; gap: 0.5rem; align-items: center; }
.stat-pill {
  font-size: 0.75rem; font-weight: 600; padding: 0.35rem 0.7rem;
  border-radius: 999px; background: rgba(52, 211, 153, 0.15);
  color: var(--success); border: 1px solid rgba(52, 211, 153, 0.35);
}
.stat-pill.muted { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.victim-log-wrap { margin-bottom: 1rem; }
.victim-log-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.8rem; color: var(--muted); margin-bottom: 0.4rem;
}
.victim-log {
  margin: 0; max-height: 220px; overflow: auto;
  background: #05070c; border: 1px solid var(--border);
  border-radius: 12px; padding: 0.75rem 0.9rem;
  font-family: var(--mono); font-size: 0.78rem; line-height: 1.45;
  color: #b8f5d0; white-space: pre-wrap; word-break: break-word;
}
.victim-log .ev-connect { color: #6ee7b7; }
.victim-log .ev-check { color: #93a0b4; }
.victim-log .ev-warn { color: #fbbf24; }
.victims-table td { vertical-align: top; }
.victim-host { font-weight: 600; }
.victim-sub { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.country-cell { white-space: nowrap; }

.bot-control { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.bot-control-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.bot-control-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.bot-control-row .input { flex: 1; min-width: 180px; }
.shell-out { max-height: 280px; color: #d1e8ff; }
.upload-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.upload-list a {
  font-size: 0.75rem; padding: 0.3rem 0.6rem; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--accent);
  text-decoration: none;
}
.victims-table tr { cursor: pointer; }
.victims-table tr.selected { background: rgba(79, 140, 255, 0.12); }
.ban-badge { color: var(--danger); font-size: 0.7rem; font-weight: 700; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .step { width: 84px; }
  .step-label { font-size: 0.68rem; }
  .topbar { padding: 0.75rem 1rem; }
  .status-text { display: none; }
  .card { padding: 1.15rem; }
  .link-box { flex-direction: column; }
}
/* ---------- view tabs / connections ---------- */
.view-tabs { display: flex; gap: 0.4rem; }
.view-tab {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  padding: 0.45rem 0.9rem; border-radius: 10px; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.view-tab:hover { color: var(--text); border-color: var(--accent); }
.view-tab.active { background: rgba(99,102,241,0.15); color: var(--text); border-color: var(--accent); }
.tab-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: 999px; background: var(--success); color: #04120b;
  font-size: 0.7rem; font-weight: 700; text-align: center;
}
.container-wide { max-width: 1200px; }
.conn-table-wrap { overflow-x: auto; }
.conn-table { width: 100%; }
.conn-row { cursor: pointer; }
.conn-row:hover td { background: rgba(99,102,241,0.06); }
.conn-row.selected td { background: rgba(99,102,241,0.12); }
.col-flag { font-size: 1.25rem; width: 2.2rem; text-align: center; }
.pill-online { color: var(--success); font-weight: 600; font-size: 0.8rem; white-space: nowrap; }
.pill-offline { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.row-open { color: var(--accent); font-size: 0.78rem; white-space: nowrap; }
.col-actions { white-space: nowrap; display: flex; align-items: center; gap: 0.35rem; justify-content: center; padding: 0.4rem 0.5rem !important; }
.btn-manage {
  appearance: none; border: 1px solid var(--border); background: var(--surface-2); color: var(--accent);
  width: 2rem; height: 2rem; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  transition: all 0.15s ease;
}
.btn-manage:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: scale(1.05); }
.row-x {
  appearance: none; border: 1px solid var(--border); background: transparent; color: var(--muted);
  width: 2rem; height: 2rem; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  transition: all 0.15s ease;
}
.row-x:hover { color: #f87171; border-color: #f87171; background: rgba(248,113,113,0.08); transform: scale(1.05); }
.per-page { width: auto; }
.conn-control { margin-top: 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.conn-control-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.conn-control-actions { display: flex; gap: 0.4rem; }
.conn-tabs { display: flex; gap: 0.4rem; margin-bottom: 0.9rem; }
.conn-tab {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  padding: 0.45rem 0.9rem; border-radius: 10px; font-size: 0.85rem; cursor: pointer;
}
.conn-tab.active { background: rgba(99,102,241,0.15); color: var(--text); border-color: var(--accent); }
.screen-wrap { margin-top: 0.75rem; }

.vnc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.65rem;
}
.vnc-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.vnc-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.vnc-switch-track {
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-strong);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}
.vnc-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #c8d0dc;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.vnc-switch input:checked + .vnc-switch-track {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 0 16px rgba(79,140,255,0.35);
}
.vnc-switch input:checked + .vnc-switch-track .vnc-switch-thumb {
  transform: translateX(22px);
  background: #fff;
}
.vnc-switch input:focus-visible + .vnc-switch-track {
  outline: 2px solid rgba(79,140,255,0.55);
  outline-offset: 2px;
}
.vnc-switch input:disabled + .vnc-switch-track { opacity: 0.45; cursor: wait; }
.vnc-switch-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  min-width: 5.5rem;
}
.vnc-live-dot {
  font-size: 0.78rem;
  color: var(--muted);
}
.vnc-live-dot.is-live { color: var(--success); }
.vnc-live-dot.is-live::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 0.4rem;
  box-shadow: 0 0 8px rgba(52,211,153,0.6);
  animation: vnc-pulse 1.6s ease-in-out infinite;
}
@keyframes vnc-pulse { 0%,100%{opacity:1} 50%{opacity:0.45} }
.vnc-app-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}
.vnc-app-picker select { min-width: 11rem; max-width: 14rem; }
.release-board { margin-top: 1rem; }
.release-board-inner {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(79,140,255,0.10), transparent 55%),
    radial-gradient(100% 70% at 100% 0%, rgba(124,92,255,0.10), transparent 50%),
    rgba(255,255,255,0.025);
  padding: 1.1rem 1.15rem 1.2rem;
  animation: rb-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.release-board-inner.ready {
  border-color: rgba(52,211,153,0.35);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(52,211,153,0.12), transparent 55%),
    radial-gradient(100% 70% at 100% 0%, rgba(79,140,255,0.08), transparent 50%),
    rgba(255,255,255,0.025);
}
.release-board-inner.fail { border-color: rgba(248,113,113,0.4); }
@keyframes rb-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.rb-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: start;
  margin-bottom: 0.95rem;
}
.rb-kicker {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}
.rb-headline { margin-top: 0.25rem; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.release-board-inner.ready .rb-headline { color: var(--success); }
.release-board-inner.fail .rb-headline { color: var(--danger); }
.rb-desc { margin-top: 0.3rem; font-size: 0.84rem; color: var(--muted); line-height: 1.45; max-width: 36rem; }
.rb-chips {
  display: inline-grid; grid-auto-flow: column; align-items: center; gap: 0.55rem;
  padding: 0.45rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(0,0,0,0.25);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rb-count { font-weight: 700; font-size: 0.95rem; }
.rb-count i { font-style: normal; color: var(--faint); margin: 0 0.15rem; }
.rb-pct { font-size: 0.8rem; font-weight: 700; color: var(--accent); }
.release-board-inner.ready .rb-pct { color: var(--success); }
.release-board-inner.fail .rb-pct { color: var(--danger); }

.rb-bar {
  position: relative; height: 8px; border-radius: 999px; overflow: hidden;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 1rem;
}
.rb-fill {
  height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), #5eead4);
  background-size: 200% 100%;
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 18px rgba(79,140,255,0.45);
  animation: rb-flow 2.4s linear infinite;
}
.release-board-inner.ready .rb-fill { background: linear-gradient(90deg, #34d399, #5eead4); animation: none; }
.release-board-inner.fail .rb-fill { background: linear-gradient(90deg, #f87171, #fb923c); animation: none; }
.rb-sheen {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,0.35) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: rb-sheen 1.8s ease-in-out infinite;
  pointer-events: none;
}
.release-board-inner:not(.run) .rb-sheen { display: none; }
@keyframes rb-flow { to { background-position: 200% 0; } }
@keyframes rb-sheen { 0% { transform: translateX(-100%); } 60%,100% { transform: translateX(100%); } }

.rb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
@media (max-width: 900px) { .rb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .rb-grid { grid-template-columns: 1fr; }
  .rb-head { grid-template-columns: 1fr; }
  .rb-chips { justify-self: start; }
}
.rb-tile {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  min-height: 4.4rem;
  padding: 0.7rem 0.75rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  animation: rb-tile 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i) * 40ms);
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
@keyframes rb-tile { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.rb-tile.wait { opacity: 0.72; }
.rb-tile.run {
  border-color: rgba(79,140,255,0.55);
  background: linear-gradient(135deg, rgba(79,140,255,0.14), rgba(124,92,255,0.10));
  box-shadow: 0 0 0 1px rgba(79,140,255,0.15), 0 10px 30px rgba(79,140,255,0.12);
  animation: rb-tile 0.4s cubic-bezier(0.22, 1, 0.36, 1) both, rb-breathe 1.6s ease-in-out infinite;
}
.rb-tile.ok { border-color: rgba(52,211,153,0.35); background: rgba(52,211,153,0.06); }
.rb-tile.fail { border-color: rgba(248,113,113,0.5); background: rgba(248,113,113,0.08); }
@keyframes rb-breathe {
  0%,100% { box-shadow: 0 0 0 1px rgba(79,140,255,0.15), 0 10px 30px rgba(79,140,255,0.12); }
  50% { box-shadow: 0 0 0 1px rgba(79,140,255,0.35), 0 10px 36px rgba(79,140,255,0.22); }
}
.rb-icon {
  width: 2.1rem; height: 2.1rem; border-radius: 12px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
  color: var(--muted);
}
.rb-tile.ok .rb-icon {
  color: #052e22; background: var(--success); border-color: transparent;
  box-shadow: 0 0 16px rgba(52,211,153,0.45);
}
.rb-tile.fail .rb-icon { color: #fff; background: var(--danger); border-color: transparent; }
.rb-tile.run .rb-icon { color: var(--accent); border-color: rgba(79,140,255,0.5); background: rgba(79,140,255,0.12); }
.rb-mark { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.rb-tile.ok .rb-mark path {
  stroke-dasharray: 24; stroke-dashoffset: 24;
  animation: rb-check 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards;
}
.rb-tile.fail .rb-mark path {
  stroke-dasharray: 16; stroke-dashoffset: 16;
  animation: rb-check 0.35s ease forwards;
}
@keyframes rb-check { to { stroke-dashoffset: 0; } }
.rb-spin {
  width: 1.05rem; height: 1.05rem; border-radius: 50%;
  border: 2px solid rgba(79,140,255,0.25); border-top-color: var(--accent);
  animation: rb-spin 0.75s linear infinite;
}
@keyframes rb-spin { to { transform: rotate(360deg); } }
.rb-dot { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--faint); }
.rb-text { min-width: 0; }
.rb-title { font-weight: 650; font-size: 0.92rem; letter-spacing: -0.01em; }
.rb-sub {
  margin-top: 0.18rem; font-size: 0.74rem; color: var(--muted); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  word-break: break-word;
}
.rb-tile.fail .rb-sub { color: #fecaca; }
.rb-state {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--faint); white-space: nowrap; align-self: start; margin-top: 0.15rem;
}
.rb-tile.ok .rb-state { color: var(--success); }
.rb-tile.fail .rb-state { color: var(--danger); }
.rb-tile.run .rb-state { color: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .rb-fill, .rb-sheen, .rb-spin, .rb-tile, .rb-mark path, .release-board-inner { animation: none !important; }
  .rb-tile.ok .rb-mark path, .rb-tile.fail .rb-mark path { stroke-dashoffset: 0; }
}
.vnc-fps {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--accent-2);
  min-width: 3.5rem;
}
.vnc-fs-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.35rem 0.5rem; }
.vnc-stage {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition:
    grid-template-rows 0.52s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.38s ease,
    transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}
.vnc-stage.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.vnc-stage-clip { overflow: hidden; min-height: 0; }
.vnc-viewport {
  position: relative;
  width: 100%;
  min-height: 220px;
  height: min(72vh, 620px);
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #05070c;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: crosshair;
}
.vnc-viewport.is-off { cursor: default; }
@media (prefers-reduced-motion: reduce) {
  .vnc-stage { transition-duration: 0.01s; }
}
.vnc-viewport:focus {
  outline: 2px solid rgba(79,140,255,0.45);
  outline-offset: 2px;
}
.vnc-frame {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.vnc-viewport.is-fullscreen {
  width: 100vw;
  height: 100vh;
  max-height: none;
  min-height: 0;
  border-radius: 0;
  border: none;
}
.vnc-viewport:fullscreen { width: 100vw; height: 100vh; max-height: none; border-radius: 0; border: none; }
.vnc-exit-fs {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(10,14,22,0.7);
  color: #e6edf7;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.vnc-exit-fs:hover { background: rgba(30,40,60,0.85); }
.vnc-waiting {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  background: rgba(5,7,12,0.72);
}
.vnc-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255,255,255,0.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: vnc-spin 0.8s linear infinite;
}
@keyframes vnc-spin { to { transform: rotate(360deg); } }
.vnc-hint {
  margin: 0.55rem 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
}
@media (max-width: 640px) {
  .vnc-app-picker { margin-left: 0; width: 100%; }
  .vnc-app-picker select { flex: 1; min-width: 0; }
  .vnc-switch-label { min-width: 4.5rem; font-size: 0.85rem; }
}
.screen-toolbar { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.screen-img { max-width: 100%; border-radius: 12px; border: 1px solid var(--border); }
.keylog-out { max-height: 340px; color: #d7e3f4; }
.shell-out { max-height: 260px; }
.btn.danger, .btn-ghost.danger { color: var(--danger); border-color: rgba(248,113,113,0.4); }
.settings-grid { display: flex; flex-direction: column; gap: 1rem; }
.setting-row { display: flex; align-items: center; gap: 0.9rem; }
.setting-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.setting-row small { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.setting-col { flex-direction: column; align-items: stretch; }
.whitelist-area { width: 100%; resize: vertical; min-height: 110px; }
.input-sm { padding: 0.4rem 0.6rem; font-size: 0.85rem; width: 110px; }
@media (max-width: 900px) { .view-tabs { order: 3; width: 100%; } .topbar { flex-wrap: wrap; } }
