:root {
  --bg: #05040a;
  --card: rgba(18, 12, 32, 0.78);
  --card-hover: rgba(28, 16, 48, 0.92);
  --line: rgba(196, 120, 255, 0.28);
  --txt: #f4ecff;
  --muted: #a897c4;
  --pink: #ff4fd8;
  --purple: #9b5cff;
  --grad: linear-gradient(110deg, #c9a6ff 0%, #a14bff 45%, #ff4fd8 100%);
  --ok: #7dffb3;
  --warn: #ffd27a;
  --bad: #ff7aa8;
  --info: #9ecbff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  color: var(--txt);
  font-family: "Noto Sans Thai", "Segoe UI", sans-serif;
  background: #000;
}
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

table tbody tr {
  transition: background 0.22s ease;
}
table tbody tr:hover td {
  background: rgba(155, 92, 255, 0.07);
}
.btn-check {
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), filter 0.2s ease, box-shadow 0.2s ease;
}
.btn-check:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 12px 28px rgba(170, 60, 255, 0.45);
}
.ghost-btn {
  transition: background 0.22s ease, border-color 0.22s ease, transform 0.2s ease;
}
.ghost-btn:hover {
  transform: translateY(-1px);
}
.stat {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s ease;
}
.stat:hover {
  transform: translateY(-2px);
  border-color: rgba(196, 120, 255, 0.4);
}
.detail-view, .home-view {
  /* stable — no bounce on poll */
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(900px 520px at 12% 20%, rgba(122, 44, 255, 0.28), transparent 60%),
    radial-gradient(820px 480px at 90% 70%, rgba(255, 47, 207, 0.2), transparent 62%),
    radial-gradient(1200px 700px at 50% -10%, #1a0a30 0%, var(--bg) 55%);
}

#stars {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.glow {
  position: fixed; border-radius: 50%; filter: blur(48px);
  opacity: 0.32; z-index: 0; pointer-events: none;
}
.glow.a { width: 420px; height: 420px; left: -90px; top: 10%; background: #7a2cff; }
.glow.b { width: 380px; height: 380px; right: -70px; bottom: 8%; background: #ff2fcf; }

.top {
  position: relative; z-index: 2;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: Orbitron, sans-serif; font-size: 13px; letter-spacing: 0.12em; font-weight: 700;
}
.brand img {
  width: 28px; height: 28px; border-radius: 8px;
  box-shadow: 0 0 18px rgba(80, 160, 255, 0.55);
}
.top-key {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 10px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(196,120,255,.28);
}
.top-key-lab {
  font-size: 10px; letter-spacing: .12em; color: #9b8bb8; font-weight: 700;
}
.top-key code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px; color: #e2c6ff;
}
.top-right { display: flex; gap: 8px; }

.ghost-btn {
  height: 34px; padding: 0 14px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.35); color: #fff; font-size: 13px; cursor: pointer;
}
.ghost-btn:hover {
  background: rgba(155,92,255,0.22);
  border-color: rgba(196,120,255,0.45);
}

main {
  position: relative; z-index: 2;
  padding: 8px 28px 40px;
  max-width: 1280px;
  margin: 0 auto;
}

.page-head { margin-bottom: 22px; }
.eyebrow {
  font-family: Orbitron, sans-serif;
  font-size: 11px; letter-spacing: 0.18em; color: #d7b6ff; margin-bottom: 8px;
}
h1 { font-size: 30px; font-weight: 700; margin-bottom: 6px; }
.sub { color: var(--muted); font-size: 14px; }

.hidden { display: none !important; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.fn-card {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 168px;
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  text-align: left;
  color: inherit;
  font: inherit;
}
.fn-card:hover {
  background: var(--card-hover);
  border-color: rgba(255, 79, 216, 0.45);
  box-shadow: 0 18px 40px rgba(80, 20, 120, 0.32), inset 0 1px 0 rgba(255,255,255,0.06);
}
.fn-card:active { filter: brightness(1.05); }

.fn-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 12px;
}
.fn-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(155, 92, 255, 0.18);
  border: 1px solid rgba(196, 120, 255, 0.28);
  color: #e7d2ff; font-size: 16px; font-weight: 700;
}
.fn-num { color: rgba(255,255,255,0.35); font-size: 12px; }

.fn-title {
  font-size: 16px; font-weight: 700; margin-bottom: 0;
  line-height: 1.25;
  flex: 1;
}

.fn-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 14px;
}
.fn-status {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--muted);
}
.fn-status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.28);
}
.fn-status.idle .dot { background: rgba(255,255,255,0.28); }
.fn-status.run .dot { background: var(--warn); box-shadow: 0 0 8px rgba(255,210,122,0.6); }
.fn-status.clean .dot, .fn-status.ok .dot { background: var(--ok); }
.fn-status.warn .dot { background: var(--warn); }
.fn-status.danger .dot, .fn-status.bad .dot { background: var(--bad); }
.fn-status.info .dot { background: var(--info); }

.fn-open {
  color: #d7b6ff; font-size: 12.5px; font-weight: 600;
  white-space: nowrap;
}
.fn-card:hover .fn-open { color: #fff; }

.detail-view { /* stable */ }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.detail-bar {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.detail-titles { flex: 1; min-width: 200px; }
.detail-titles h1 { font-size: 26px; margin-bottom: 4px; }

.cta {
  height: 44px; min-width: 120px; padding: 0 22px;
  border: 0; border-radius: 12px; background: var(--grad);
  color: #fff; font-weight: 700; font-size: 15px; cursor: pointer;
  box-shadow: 0 10px 28px rgba(170, 60, 255, 0.35);
}
.cta:hover { filter: brightness(1.06); }
.cta:disabled { opacity: 0.55; cursor: wait; }

.detail-filters {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 12px;
}
.detail-filters.hidden { display: none; }

.src-pick { position: relative; }
.src-btn {
  display: flex; align-items: center; gap: 10px;
  min-width: 180px; height: 40px; padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(196, 120, 255, 0.35);
  background: rgba(20, 10, 36, 0.85);
  color: #efe6ff; font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.src-btn:hover { border-color: rgba(255, 79, 216, 0.55); background: rgba(40, 16, 64, 0.9); }
.src-chev { margin-left: auto; font-size: 11px; color: #c9a6ff; opacity: 0.85; }
.src-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  min-width: 240px; max-height: 320px; overflow-y: auto;
  border-radius: 12px;
  border: 1px solid rgba(196, 120, 255, 0.28);
  background: rgba(16, 8, 28, 0.98);
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
  padding: 6px;
}
.src-menu.hidden { display: none; }
.src-item {
  display: block; width: 100%; text-align: left;
  border: 0; background: transparent; color: #dccfff;
  font: inherit; font-size: 13px; padding: 9px 12px;
  border-radius: 8px; cursor: pointer;
}
.src-item:hover { background: rgba(155, 92, 255, 0.18); color: #fff; }
.src-item.on { background: rgba(255, 79, 216, 0.2); color: #fff; font-weight: 700; }

.detail-tools {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 12px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.08);
}
.detail-tools input, .detail-tools textarea {
  flex: 1; min-width: 220px;
  height: 42px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.4); color: #fff;
  padding: 0 12px; outline: none;
  font: inherit;
}
.detail-tools textarea { height: 88px; padding: 10px 12px; resize: vertical; }
.detail-tools input:focus, .detail-tools textarea:focus {
  border-color: rgba(185, 110, 255, 0.7);
}

.err { min-height: 18px; color: var(--bad); font-size: 13px; margin-bottom: 8px; }

.progress {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(155, 92, 255, 0.1);
  border: 1px solid rgba(196, 120, 255, 0.28);
  box-shadow: 0 0 24px rgba(155, 92, 255, 0.12);
}
.progress-meta {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}
.progress-pct {
  font-family: Orbitron, sans-serif;
  font-size: 18px; font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.progress-label {
  color: var(--muted); font-size: 13px; text-align: right;
}
.progress-bar {
  position: relative;
  height: 10px; border-radius: 999px;
  background: rgba(255,255,255,0.08); overflow: hidden;
}
.progress-bar i {
  display: block; height: 100%; width: 0%;
  background: var(--grad); border-radius: 999px;
  transition: width 0.25s ease;
  box-shadow: 0 0 16px rgba(255, 79, 216, 0.55);
  position: relative;
}
.progress-bar i::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: sheen 1.2s linear infinite;
}
@keyframes sheen {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.scan-stage {
  display: grid; place-items: center;
  min-height: 280px; text-align: center; padding: 28px 20px;
}
.scan-ring {
  position: relative;
  width: 108px; height: 108px;
  margin-bottom: 18px;
}
.scan-ring svg { width: 108px; height: 108px; transform: rotate(-90deg); }
.scan-ring .track {
  fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 8;
}
.scan-ring .arc {
  fill: none; stroke: url(#scanGrad); stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 302;
  stroke-dashoffset: 302;
  transition: stroke-dashoffset 0.25s ease;
  filter: drop-shadow(0 0 8px rgba(255, 79, 216, 0.55));
}
.scan-ring .core {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: Orbitron, sans-serif;
  font-size: 18px; font-weight: 700; color: #fff;
}
.scan-pulse {
  position: absolute; inset: -8px; border-radius: 50%;
  border: 1px solid rgba(196, 120, 255, 0.35);
  animation: pulseRing 1.6s ease-out infinite;
}
@keyframes pulseRing {
  0% { transform: scale(0.92); opacity: 0.7; }
  100% { transform: scale(1.18); opacity: 0; }
}
.scan-title {
  font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 6px;
}
.scan-sub {
  color: var(--muted); font-size: 13.5px; max-width: 360px; margin: 0 auto 14px;
  line-height: 1.45;
}
.scan-dots span {
  display: inline-block; width: 7px; height: 7px; margin: 0 3px;
  border-radius: 50%; background: #c9a6ff;
  animation: dotBlink 1.1s infinite ease-in-out;
}
.scan-dots span:nth-child(2) { animation-delay: 0.15s; }
.scan-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotBlink {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.cta.scanning {
  pointer-events: none;
  animation: ctaGlow 1.4s ease-in-out infinite;
}
@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 10px 28px rgba(170, 60, 255, 0.35); }
  50% { box-shadow: 0 10px 34px rgba(255, 79, 216, 0.55), 0 0 22px rgba(155, 92, 255, 0.35); }
}

.panel {
  border-radius: 22px;
  background: rgba(12, 8, 24, 0.55);
  border: 1px solid rgba(196, 120, 255, 0.22);
  min-height: 280px;
  padding: 18px;
  backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.result-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 14px;
  background: linear-gradient(120deg, rgba(155,92,255,0.16), rgba(255,79,216,0.08));
  border: 1px solid rgba(196,120,255,0.28);
}
.result-summary-left {
  display: flex; align-items: center; gap: 12px;
}
.result-summary-title {
  font-weight: 700; font-size: 14.5px; line-height: 1.35;
}
.result-summary-sub {
  color: var(--muted); font-size: 12px; margin-top: 2px;
}

.badge, .pill {
  display: inline-flex; align-items: center; justify-content: center;
  height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  border: 1px solid transparent; white-space: nowrap;
}
.badge.clean, .badge.ok, .pill.clean, .pill.ok {
  color: #b8ffd7; background: rgba(125,255,179,0.12); border-color: rgba(125,255,179,0.28);
}
.badge.warn, .pill.warn {
  color: #ffe2a8; background: rgba(255,210,122,0.12); border-color: rgba(255,210,122,0.3);
}
.badge.danger, .badge.bad, .pill.danger, .pill.bad {
  color: #ffc0d4; background: rgba(255,122,168,0.14); border-color: rgba(255,122,168,0.32);
}
.badge.info, .pill.info {
  color: #cfe3ff; background: rgba(158,203,255,0.12); border-color: rgba(158,203,255,0.28);
}

.hit-list { display: flex; flex-direction: column; gap: 12px; }

.hit {
  position: relative;
  display: flex;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(196,120,255,0.14);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}
.hit:hover {
  background: rgba(255,255,255,0.055);
  border-color: rgba(196,120,255,0.38);
  box-shadow: 0 10px 28px rgba(0,0,0,0.22);
}
.hit-accent {
  width: 4px; flex: 0 0 4px;
  background: rgba(255,255,255,0.18);
}
.hit.ok .hit-accent, .hit.clean .hit-accent { background: linear-gradient(#7dffb3, #3ecf8e); }
.hit.warn .hit-accent { background: linear-gradient(#ffd27a, #ff9f43); }
.hit.danger .hit-accent, .hit.bad .hit-accent { background: linear-gradient(#ff7aa8, #ff4fd8); }
.hit.info .hit-accent { background: linear-gradient(#9ecbff, #9b5cff); }

.hit-body { flex: 1; padding: 16px 18px 14px; min-width: 0; }
.hit-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.hit-index {
  font-size: 11px; color: rgba(255,255,255,0.32); letter-spacing: 0.04em;
}
.hit-title {
  font-size: 15.5px; font-weight: 700; line-height: 1.35;
  margin-bottom: 8px; color: #fff;
  word-break: break-word;
  letter-spacing: -0.01em;
}
.hit-line {
  color: #d5c6ef; font-size: 13.5px; line-height: 1.65;
  margin-bottom: 4px; word-break: break-word;
  white-space: pre-wrap;
}
.hit-line.muted { color: var(--muted); font-size: 12.5px; }

.hit-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 12px; flex-wrap: wrap;
}
.hit-time {
  font-size: 12px; color: #e7d2ff;
  background: rgba(155,92,255,0.14);
  border: 1px solid rgba(196,120,255,0.22);
  border-radius: 999px; padding: 4px 10px;
}
.hit-src { font-size: 12px; color: var(--muted); }

.hit-path {
  margin-top: 10px; padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.07);
  color: #b8c0d4;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px; line-height: 1.45;
  word-break: break-all;
  display: flex; gap: 10px; align-items: flex-start;
}
.hit-path span {
  flex: 0 0 auto;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  color: #c9a6ff; opacity: 0.95; margin-top: 1px;
}
.hit-path code {
  flex: 1; font: inherit; color: #e8e2f5; background: none; white-space: pre-wrap;
}

.empty {
  display: grid; place-items: center; min-height: 240px;
  color: var(--muted); text-align: center; padding: 28px;
}
.empty-ico {
  width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center; margin-bottom: 12px;
  background: rgba(125,255,179,0.12);
  border: 1px solid rgba(125,255,179,0.25);
  color: #b8ffd7; font-size: 22px;
}
.empty-title { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.empty-sub { font-size: 13px; }

.detail-bar {
  padding: 4px 0 8px;
}
.detail-titles h1 {
  letter-spacing: -0.02em;
}
.cta {
  box-shadow: 0 10px 28px rgba(170, 60, 255, 0.45), 0 0 24px rgba(255, 79, 216, 0.2);
}

@media (max-width: 980px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding: 8px 16px 32px; }
}
@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr; }
  h1 { font-size: 24px; }
  .detail-bar { align-items: stretch; }
  .detail-actions { width: 100%; }
  .cta, .cta-cancel { flex: 1; width: auto; }
  .hit-title { font-size: 15px; }
}

/* —— Login gate (Systemcore localhost) —— */
body.gate:not(.authed) .login-shell { display: flex !important; flex-direction: column; }
body.authed .app-shell { display: block !important; }

body.gate { display: block; user-select: none; }
body.authed { display: block; user-select: auto; }
body.authed .login-shell { display: none !important; }
body.gate:not(.authed) .app-shell { display: none !important; }
.app-shell.hidden, .login-shell.hidden { display: none !important; }

.login-shell {
  position: relative; z-index: 4; min-height: 100vh;
  display: flex; flex-direction: column;
}
.login-top {
  height: 64px; display: flex; align-items: center; padding: 0 28px;
}
.login-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: Orbitron, sans-serif; font-size: 13px;
  letter-spacing: 0.12em; font-weight: 700;
}
.login-brand img {
  width: 28px; height: 28px; border-radius: 8px;
  box-shadow: 0 0 18px rgba(80, 160, 255, 0.55);
}
.login-main {
  flex: 1; display: grid; place-items: center; padding: 12px 18px 48px;
}
.login-card {
  width: min(400px, calc(100vw - 40px));
  background: rgba(16, 12, 28, 0.72);
  border: 1px solid rgba(196, 120, 255, 0.32);
  border-radius: 22px;
  padding: 28px 26px 24px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 0 0 1px rgba(255,79,216,0.08), 0 24px 70px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.06);
  text-align: center; animation: rise 0.55s ease both;
}
.login-logo {
  width: 72px; height: 72px; border-radius: 16px; object-fit: cover;
  margin: 0 auto 12px; display: block;
  box-shadow: 0 0 0 3px rgba(80,160,255,0.28), 0 0 32px rgba(80,160,255,0.4);
  animation: logoPulse 2.8s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(80,160,255,0.35)); }
  50% { filter: drop-shadow(0 0 18px rgba(155,92,255,0.75)); }
}
.login-eyebrow {
  font-family: Orbitron, sans-serif; font-size: 10px;
  letter-spacing: 0.18em; color: #d7b6ff; margin-bottom: 8px;
}
.login-title { font-size: 28px !important; font-weight: 700; margin-bottom: 6px !important; color: #fff; line-height: 1.2; }
.login-sub { color: #b5a4d0; font-size: 13.5px !important; margin-bottom: 18px !important; line-height: 1.4; }
.login-lab {
  display: block; text-align: left; font-size: 11px;
  letter-spacing: 0.14em; color: #b5a4d0; margin: 8px 0 6px;
}
.login-input {
  width: 100%; height: 42px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.35) !important; color: #fff !important;
  padding: 0 14px; font-size: 14px; outline: none; font-family: inherit;
  letter-spacing: 0.1em; -webkit-text-fill-color: #fff; box-sizing: border-box; user-select: text;
}
.login-input:focus {
  border-color: rgba(185, 110, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(155, 92, 255, 0.18);
}
.login-input::placeholder {
  color: rgba(181, 164, 208, 0.55); -webkit-text-fill-color: rgba(181, 164, 208, 0.55);
}
.login-err {
  min-height: 20px; margin-top: 10px; margin-bottom: 2px;
  color: #ff6b9d; font-size: 13.5px; font-weight: 700;
  letter-spacing: 0.02em;
}
.login-err:not(:empty) {
  animation: loginShake 0.35s ease;
}
@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.login-cta {
  width: 100%; height: 44px; margin-top: 10px; border: 0; border-radius: 12px;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 15px; font-family: inherit;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 28px rgba(170, 60, 255, 0.35);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.login-cta:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }
.login-cta:disabled { opacity: 0.55; cursor: wait; }

.app-shell { position: relative; z-index: 2; min-height: 100vh; }

.app-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 64px);
  align-items: start;
}
.side-nav {
  position: sticky;
  top: 0;
  align-self: start;
  padding: 12px 14px 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: calc(100vh - 64px);
  border-right: 1px solid rgba(196,120,255,.18);
  background: rgba(10, 6, 20, .35);
  backdrop-filter: blur(10px);
}
.side-label {
  margin: 4px 8px 6px;
  color: #7d6e96;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
}
.side-link {
  text-align: left;
  cursor: pointer;
  color: #f4ecff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.side-link:hover {
  background: rgba(196,120,255,.1);
  border-color: rgba(196,120,255,.28);
}
.side-link.on {
  background: linear-gradient(110deg, rgba(161,75,255,.35), rgba(255,79,216,.28));
  border-color: rgba(255,79,216,.45);
}
.side-foot {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.side-link.side-logout {
  color: #ffc0d2;
  border-color: rgba(255,122,168,.28);
  background: rgba(255,79,120,.08);
}
.side-link.side-logout:hover {
  color: #ffe0ea;
  background: rgba(255,79,120,.18);
  border-color: rgba(255,122,168,.55);
}
.app-main {
  position: relative;
  z-index: 2;
  padding: 8px 28px 40px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
.launch-card {
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
  padding: 18px;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
}
.launch-cmd {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(0,0,0,.38);
  border: 1px solid rgba(196,120,255,.22);
  color: #e8d9ff;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 88px;
}
.launch-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.launch-copy-ok {
  color: #7dffb3;
  font-size: 13px;
  font-weight: 600;
}
@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }
  .side-nav {
    position: relative;
    min-height: 0;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid rgba(196,120,255,.18);
    padding: 12px 16px;
  }
  .side-label { width: 100%; margin: 0 0 4px 4px; }
  .side-foot {
    margin-top: 0;
    padding-top: 0;
    width: 100%;
    flex-direction: row;
  }
}

.pill {
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(155,92,255,.2); border: 1px solid rgba(196,120,255,.35); color: #fff;
  display: inline-flex; align-items: center;
}

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px;
}
.stat {
  padding: 14px 16px; border-radius: 16px; background: var(--card);
  border: 1px solid var(--line); backdrop-filter: blur(14px);
}
.stat b { display: block; font-size: 26px; font-weight: 700; margin-bottom: 2px; }
.stat span { color: var(--muted); font-size: 12px; }
.stat.on b { color: var(--ok); }
.stat.warn b { color: var(--warn); }

.table-wrap {
  border-radius: 18px; background: var(--card); border: 1px solid var(--line);
  backdrop-filter: blur(16px); overflow: hidden;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}
.table-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  padding: 16px 18px 12px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.dash-empty-row td { border-bottom: 0 !important; padding: 36px 16px !important; }
.dash-empty {
  display: grid; place-items: center; text-align: center;
  min-height: 220px; color: var(--muted);
}
.dash-empty .empty-orb { margin-bottom: 14px; }
.dash-empty .empty-title { font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.dash-empty .empty-sub { font-size: 13px; max-width: 420px; line-height: 1.45; }
.host-name { font-weight: 700; color: #fff; margin-bottom: 2px; }
.discord-cell {
  display: flex; align-items: center; gap: 10px; min-width: 160px;
}
.discord-cell.muted .host-name { color: var(--muted); font-weight: 600; }
.discord-av {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(88,101,242,0.25);
}
.discord-av.ph {
  display: inline-block;
  background: linear-gradient(135deg, #5865f2, #3c45a5);
}
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 12px 16px; text-align: left; font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
th { color: var(--muted); font-weight: 600; font-size: 12px; }
td .mono { font-family: Consolas, monospace; font-size: 12px; color: var(--muted); }
.dot {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600;
}
.dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 10px currentColor;
}
.dot.online { color: var(--ok); }
.dot.offline { color: var(--bad); }
.dot.checking { color: var(--warn); }
.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
}
.badge.queued { background: rgba(255,210,122,0.12); border-color: rgba(255,210,122,0.35); color: var(--warn); }
.badge.running { background: rgba(155,92,255,0.16); border-color: rgba(196,120,255,0.4); color: #e7d2ff; }
.badge.done { background: rgba(125,255,179,0.1); border-color: rgba(125,255,179,0.3); color: var(--ok); }
.btn-check {
  height: 36px; padding: 0 14px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--grad); color: #fff; font: inherit; font-size: 12.5px; font-weight: 700;
  box-shadow: 0 8px 22px rgba(170, 60, 255, 0.35); white-space: nowrap;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), filter 0.2s ease, box-shadow 0.2s ease;
}
.btn-check:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.row-actions {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
}
.btn-finish {
  height: 36px; padding: 0 14px; border: 0; border-radius: 10px; cursor: pointer;
  background: linear-gradient(110deg, #ff5a7a 0%, #e11d48 55%, #be123c 100%);
  color: #fff; font: inherit; font-size: 12.5px; font-weight: 700;
  box-shadow: 0 8px 22px rgba(225, 29, 72, 0.4); white-space: nowrap;
  transition: filter 0.2s ease, box-shadow 0.2s ease;
}
.btn-finish:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 10px 26px rgba(225, 29, 72, 0.5);
}
.btn-finish:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-msgbox {
  height: 36px; padding: 0 14px; border: 0; border-radius: 10px; cursor: pointer;
  background: linear-gradient(110deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
  color: #fff; font: inherit; font-size: 12.5px; font-weight: 700;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.35); white-space: nowrap;
  transition: filter 0.2s ease, box-shadow 0.2s ease;
}
.btn-msgbox:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.5);
}
.btn-msgbox:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.badge.finishing {
  background: rgba(255,122,168,0.14); border-color: rgba(255,122,168,0.4); color: #ffb3c9;
}
.dot.finishing { color: var(--bad); }
.fn-desc { color: var(--muted); font-size: 12.5px; margin-top: 8px; line-height: 1.4; flex: 1; }

.tool-label { display: block; width: 100%; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.tool-input, .tool-area {
  flex: 1; min-width: 220px; width: 100%; height: 42px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.4); color: #fff;
  padding: 0 12px; outline: none; font: inherit; box-sizing: border-box;
}
.tool-area { height: 88px; padding: 10px 12px; resize: vertical; }
.tool-input:focus, .tool-area:focus {
  border-color: rgba(185, 110, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(155, 92, 255, 0.16);
}
.detail-tools {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 14px; padding: 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(28,16,48,0.55), rgba(0,0,0,0.28));
  border: 1px solid rgba(196,120,255,0.22);
}
.tool-row {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
}
.tool-field { flex: 1; min-width: 220px; }
.tool-field.full { width: 100%; }
.tool-pick {
  height: 42px; padding: 0 16px; border-radius: 11px; border: 0;
  background: rgba(155,92,255,0.22); color: #efe6ff; font: inherit; font-weight: 700;
  font-size: 13px; cursor: pointer; white-space: nowrap;
  border: 1px solid rgba(196,120,255,0.4);
  transition: background 0.15s ease, transform 0.15s ease;
}
.tool-pick:hover { background: rgba(155,92,255,0.38); transform: translateY(-1px); }
.tool-hint { font-size: 12px; color: var(--muted); line-height: 1.4; }

.detail-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cta-cancel {
  height: 44px; min-width: 120px; padding: 0 18px;
  border: 1px solid rgba(255,122,168,0.45);
  border-radius: 12px;
  background: rgba(80, 16, 40, 0.85);
  color: #ffb3c9; font-weight: 700; font-size: 14px; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}
.cta-cancel:hover {
  background: rgba(120, 24, 56, 0.95);
  border-color: rgba(255,122,168,0.75);
  filter: brightness(1.05);
}
.cta-cancel.active {
  border-color: rgba(255,79,120,0.85);
  box-shadow: 0 0 18px rgba(255, 79, 120, 0.25);
}
.cta-cancel:disabled { opacity: 0.45; cursor: not-allowed; }
.danger-ghost {
  border-color: rgba(255,122,168,0.35) !important;
  color: #ffb3c9 !important;
}
.danger-ghost:hover {
  background: rgba(255,122,168,0.16) !important;
  border-color: rgba(255,122,168,0.55) !important;
}
.cta.scanning {
  background: linear-gradient(110deg, #7a4bb8, #a14bff 50%, #c44fd8);
  animation: ctaPulse 1.4s ease-in-out infinite;
}
@keyframes ctaPulse {
  0%, 100% { filter: brightness(1); box-shadow: 0 10px 28px rgba(170, 60, 255, 0.35); }
  50% { filter: brightness(1.1); box-shadow: 0 10px 36px rgba(255, 79, 216, 0.45); }
}

.results.panel {
  border-radius: 20px;
  background: rgba(12, 8, 22, 0.55);
  border: 1px solid rgba(196,120,255,0.18);
  backdrop-filter: blur(18px);
  min-height: 320px;
  padding: 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
}

.scan-card {
  position: relative;
  display: flex; align-items: center; gap: 28px;
  min-height: 260px; padding: 28px 32px;
  overflow: hidden;
}
.scan-card-glow {
  position: absolute; inset: auto;
  width: 280px; height: 280px; left: -40px; top: 50%; transform: translateY(-50%);
  background: radial-gradient(circle, rgba(161,75,255,0.35), transparent 68%);
  pointer-events: none; filter: blur(10px);
}
.scan-copy { position: relative; z-index: 1; flex: 1; min-width: 180px; }
.scan-kicker {
  font-family: Orbitron, sans-serif; font-size: 10px; letter-spacing: 0.18em;
  color: #d7b6ff; margin-bottom: 8px;
}
.scan-title { font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.scan-sub { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.scan-track {
  height: 8px; border-radius: 999px; background: rgba(255,255,255,0.08);
  overflow: hidden; margin-bottom: 14px; max-width: 360px;
}
.scan-track i {
  display: block; height: 100%; width: 0%;
  background: var(--grad); border-radius: 999px;
  box-shadow: 0 0 16px rgba(255, 79, 216, 0.55);
  transition: width 0.3s ease;
}
.scan-ring { position: relative; z-index: 1; width: 118px; height: 118px; flex: 0 0 118px; }
.scan-ring svg { width: 118px; height: 118px; transform: rotate(-90deg); }
.scan-ring .track { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 8; }
.scan-ring .arc {
  fill: none; stroke: url(#scanGrad); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 302; stroke-dashoffset: 302; transition: stroke-dashoffset 0.3s ease;
  filter: drop-shadow(0 0 8px rgba(255, 79, 216, 0.55));
}
.scan-ring .core {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: Orbitron, sans-serif; font-size: 20px; font-weight: 700; color: #fff;
}
.scan-pulse {
  position: absolute; inset: -10px; border-radius: 50%;
  border: 1px solid rgba(196, 120, 255, 0.35);
  animation: pulseRing 1.6s ease-out infinite;
}
@keyframes pulseRing {
  0% { transform: scale(0.92); opacity: 0.7; }
  100% { transform: scale(1.2); opacity: 0; }
}
.scan-dots { display: flex; gap: 6px; }
.scan-dots span {
  width: 6px; height: 6px; border-radius: 50%; background: rgba(196,120,255,0.55);
  animation: dotBlink 1.2s ease-in-out infinite;
}
.scan-dots span:nth-child(2) { animation-delay: 0.2s; }
.scan-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBlink {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

.empty.ready .empty-orb, .empty-orb {
  width: 64px; height: 64px; border-radius: 20px; margin-bottom: 14px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,79,216,0.55), transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(155,92,255,0.65), transparent 55%),
    rgba(20,10,40,0.9);
  border: 1px solid rgba(196,120,255,0.35);
  box-shadow: 0 0 28px rgba(155,92,255,0.35);
  animation: orbFloat 3s ease-in-out infinite;
}
@keyframes orbFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@media (max-width: 720px) {
  .scan-card { flex-direction: column; text-align: center; padding: 28px 18px; gap: 18px; }
  .scan-card-glow { left: 50%; top: 10%; transform: translateX(-50%); }
  .scan-track { margin-left: auto; margin-right: auto; }
  .scan-dots { justify-content: center; }
}

.key-modal-actions .ghost-btn {
  min-width: 110px;
}

.machine-chip {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 14px; padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0,0,0,.32);
  border: 1px solid rgba(196,120,255,.28);
  text-align: left;
}
.machine-chip-av {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: rgba(155,92,255,.2) center/cover no-repeat;
  border: 1px solid rgba(196,120,255,.35);
}
.machine-chip-av.ph {
  background: linear-gradient(135deg, rgba(155,92,255,.35), rgba(80,160,255,.2));
}
.machine-chip-host {
  font-weight: 700; color: #fff; font-size: 13.5px; line-height: 1.25;
}
.machine-chip-sub {
  color: #a897c4; font-size: 12px; margin-top: 2px;
  font-family: ui-monospace, Consolas, monospace;
}

/* Finish confirm — per-machine card */
.sc-confirm {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100000 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}
.sc-confirm.is-open { display: flex !important; }
.sc-confirm.hidden { display: none !important; }
.sc-confirm-backdrop {
  position: absolute; inset: 0;
  background: rgba(2, 0, 8, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.sc-confirm-card {
  position: relative; z-index: 2;
  width: min(440px, calc(100vw - 32px));
  padding: 28px 26px 22px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(165deg, rgba(42, 22, 68, 0.98), rgba(12, 6, 24, 0.99));
  border: 1px solid rgba(196,120,255,.38);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.04) inset,
    0 28px 80px rgba(0,0,0,.55),
    0 0 60px rgba(155,92,255,.18);
  animation: scConfirmIn .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes scConfirmIn {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to { opacity: 1; transform: none; }
}
.sc-confirm-glow {
  pointer-events: none;
  position: absolute; top: -40%; left: 20%; right: 20%; height: 60%;
  background: radial-gradient(ellipse, rgba(255,79,136,.22), transparent 70%);
}
.sc-confirm-eyebrow {
  position: relative;
  margin: 0 0 8px;
  font-family: Orbitron, sans-serif;
  font-size: 10px; letter-spacing: .18em; color: #d7b6ff;
}
.sc-confirm-title {
  position: relative;
  margin: 0 0 8px;
  font-size: 22px; font-weight: 700; color: #fff; letter-spacing: .02em;
}
.sc-confirm-lead {
  position: relative;
  margin: 0 0 18px;
  color: #b5a4d0; font-size: 13.5px; line-height: 1.45;
}
.sc-confirm-machine {
  position: relative;
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px;
  border-radius: 16px;
  background: rgba(0,0,0,.38);
  border: 1px solid rgba(196,120,255,.22);
  margin-bottom: 20px;
}
.sc-confirm-av {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(155,92,255,.4), rgba(80,160,255,.25)) center/cover no-repeat;
  border: 1px solid rgba(196,120,255,.4);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.sc-confirm-host {
  font-weight: 700; font-size: 15px; color: #fff;
  word-break: break-all;
}
.sc-confirm-sub {
  margin-top: 3px;
  color: #a897c4; font-size: 12.5px;
  font-family: ui-monospace, Consolas, monospace;
}
.sc-confirm-tags {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
}
.sc-tag {
  display: inline-block;
  padding: 4px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  color: #e2c6ff;
  background: rgba(155,92,255,.16);
  border: 1px solid rgba(196,120,255,.28);
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sc-confirm-actions {
  position: relative;
  display: flex; gap: 10px; justify-content: flex-end;
}
.sc-btn-cancel, .sc-btn-ok {
  height: 44px; min-width: 112px; padding: 0 18px;
  border: 0; border-radius: 12px;
  font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
  transition: transform .15s ease, filter .15s ease, background .15s ease;
}
.sc-btn-cancel {
  background: rgba(255,255,255,.08); color: #f4ecff;
  border: 1px solid rgba(255,255,255,.12);
}
.sc-btn-cancel:hover { background: rgba(255,255,255,.14); }
.sc-btn-ok {
  background: linear-gradient(110deg, #ff4f88, #c41d5a);
  color: #fff;
  box-shadow: 0 10px 28px rgba(196,29,90,.35);
}
.sc-btn-ok:hover { filter: brightness(1.08); transform: translateY(-1px); }
.sc-btn-ok:active, .sc-btn-cancel:active { transform: translateY(0); }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* Key gate popup — centered overlay */
.key-modal {
  position: fixed !important;
  top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
  inset: 0 !important;
  z-index: 99999 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  margin: 0 !important;
}
.key-modal.is-open {
  display: flex !important;
}
.key-modal.hidden {
  display: none !important;
}
.key-modal-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(3, 1, 10, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.key-modal-card {
  position: relative !important;
  z-index: 2;
  width: min(420px, calc(100vw - 32px));
  max-width: 420px;
  margin: 0 auto;
  padding: 30px 26px 24px;
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(36, 20, 58, 0.98), rgba(14, 8, 28, 0.99));
  border: 1px solid rgba(196, 120, 255, 0.4);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 28px 80px rgba(0, 0, 0, 0.65),
    0 0 48px rgba(155, 92, 255, 0.22);
  animation: keyPopIn 0.22s ease-out;
}
@keyframes keyPopIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.key-modal-title {
  font-family: Orbitron, sans-serif;
  font-size: 20px;
  margin: 6px 0 8px;
  color: #f3eaff;
  letter-spacing: 0.02em;
}
.key-modal-sub {
  color: #b5a4d0;
  font-size: 13.5px;
  line-height: 1.45;
  margin: 0 0 18px;
}
.key-modal .login-lab { display: block; margin-bottom: 8px; }
.key-modal .login-input { width: 100%; box-sizing: border-box; }
.key-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 16px;
}
.key-modal-actions .login-cta {
  width: auto !important;
  min-width: 128px;
  margin: 0 !important;
  padding: 12px 20px !important;
  flex: 0 0 auto;
}
.key-modal-actions .ghost-btn {
  margin: 0;
  flex: 0 0 auto;
}

/* Remote file browser — UI on operator, data from checked PC */
.remote-fs-modal {
  position: fixed; inset: 0; z-index: 80;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
}
.remote-fs-modal.is-open { display: flex; }
.remote-fs-card {
  width: min(720px, 100%);
  max-height: min(820px, calc(100vh - 40px));
  display: flex; flex-direction: column;
  background: rgba(16, 12, 28, 0.94);
  border: 1px solid rgba(196, 120, 255, 0.35);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(255,79,216,.08);
  overflow: hidden;
}
.remote-fs-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(196,120,255,.18);
}
.remote-fs-title {
  font-family: Orbitron, sans-serif; font-size: 13px; letter-spacing: .12em; font-weight: 700; color: #fff;
}
.remote-fs-host { margin-top: 4px; color: #a897c4; font-size: 12.5px; }
.remote-fs-x {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.25); color: #fff; font-size: 20px; cursor: pointer; line-height: 1;
}
.remote-fs-path {
  display: flex; gap: 8px; align-items: center; padding: 10px 14px;
  border-bottom: 1px solid rgba(196,120,255,.14);
}
.remote-fs-up {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(196,120,255,.28);
  background: rgba(155,92,255,.18); color: #fff; font-size: 16px; cursor: pointer;
}
.remote-fs-path-input {
  flex: 1; height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.35); color: #e8d9ff; padding: 0 12px; font-size: 12.5px;
  font-family: ui-monospace, Consolas, monospace;
}
.remote-fs-list {
  flex: 1; overflow: auto; min-height: 280px; max-height: 480px;
  padding: 6px;
}
.remote-fs-row {
  width: 100%; display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center;
  text-align: left; border: 0; background: transparent; color: #f4ecff;
  padding: 10px 12px; border-radius: 10px; cursor: pointer; font-family: inherit; font-size: 13.5px;
}
.remote-fs-row:hover { background: rgba(155,92,255,.12); }
.remote-fs-row.on { background: rgba(155,92,255,.22); box-shadow: inset 0 0 0 1px rgba(196,120,255,.35); }
.remote-fs-ico {
  width: 22px; height: 22px; border-radius: 6px;
  background: rgba(255,255,255,.08);
  position: relative;
}
.remote-fs-ico.dir {
  background: linear-gradient(160deg, #c9a6ff, #7a3dff);
  box-shadow: 0 0 12px rgba(155,92,255,.35);
}
.remote-fs-ico.file {
  background: linear-gradient(160deg, #5a6a88, #2a3348);
}
.remote-fs-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remote-fs-meta { color: #a897c4; font-size: 12px; }
.remote-fs-empty { padding: 48px 16px; text-align: center; color: #a897c4; }
.remote-fs-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px 16px; border-top: 1px solid rgba(196,120,255,.18);
}
.remote-fs-status { color: #a897c4; font-size: 12.5px; }
.remote-fs-actions { display: flex; gap: 8px; }
.remote-fs-ok {
  width: auto !important; min-width: 120px; height: 40px !important; margin: 0 !important;
  padding: 0 16px !important;
}


