.vps-panel-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  color: #f8f4eb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.vps-panel-launcher {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.vps-panel-root[hidden] {
  display: none;
}

.vps-panel-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(248, 244, 235, 0.22);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(8, 12, 14, 0.82);
  color: #f8f4eb;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.34);
  backdrop-filter: none;
  cursor: pointer;
}

.vps-radar-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(248, 244, 235, 0.18);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(8, 12, 14, 0.82);
  color: rgba(248, 244, 235, 0.84);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.vps-radar-badge.is-active {
  border-color: rgba(127, 176, 105, 0.45);
}

.vps-radar-badge.is-scanning {
  border-color: rgba(242, 174, 88, 0.45);
}

.vps-radar-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #6b7280;
  box-shadow: 0 0 0 4px rgba(107, 114, 128, 0.16);
}

.vps-radar-dot.is-active {
  background: #7fb069;
  box-shadow: 0 0 0 4px rgba(127, 176, 105, 0.2);
}

.vps-radar-dot.is-scanning {
  background: #f2ae58;
  box-shadow: 0 0 0 4px rgba(242, 174, 88, 0.2);
  animation: vpsRadarPulse 1.35s ease-in-out infinite;
}

@keyframes vpsRadarPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(242, 174, 88, 0.35);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(242, 174, 88, 0.04);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(242, 174, 88, 0);
  }
}

.vps-panel-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #6b7280;
  box-shadow: 0 0 0 4px rgba(107, 114, 128, 0.18);
}

.vps-panel-status-dot.is-online {
  background: #7fb069;
  box-shadow: 0 0 0 4px rgba(127, 176, 105, 0.2);
}

.vps-panel-status-dot.is-warning {
  background: #f2ae58;
  box-shadow: 0 0 0 4px rgba(242, 174, 88, 0.2);
}

.vps-panel-shell {
  position: absolute;
  right: 0;
  bottom: 54px;
  width: min(520px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 92px));
  display: none;
  overflow: hidden;
  border: 1px solid rgba(248, 244, 235, 0.16);
  border-radius: 18px;
  background: rgba(8, 12, 14, 0.93);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  backdrop-filter: none;
  contain: layout paint style;
  transform: translateZ(0);
}

.vps-panel-resize-handle {
  position: absolute;
  top: 0;
  left: -8px;
  width: 16px;
  height: 100%;
  cursor: ew-resize;
  touch-action: none;
}

.vps-panel-resize-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 6px;
  width: 2px;
  height: 56px;
  border-radius: 999px;
  background: rgba(248, 244, 235, 0.22);
  transform: translateY(-50%);
}

.vps-panel-root.is-open .vps-panel-shell {
  display: grid;
  grid-template-rows: auto 1fr;
}

.vps-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid rgba(248, 244, 235, 0.12);
}

.vps-panel-kicker {
  margin: 0 0 4px;
  color: #f2ae58;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.vps-panel-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.vps-panel-subtitle {
  margin: 5px 0 0;
  color: rgba(248, 244, 235, 0.62);
  font-size: 12px;
}

.vps-panel-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(248, 244, 235, 0.16);
  border-radius: 999px;
  background: rgba(248, 244, 235, 0.06);
  color: #f8f4eb;
  cursor: pointer;
}

.vps-panel-body {
  overflow: auto;
  padding: 16px;
}

.vps-panel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.vps-panel-card {
  min-width: 0;
  border: 1px solid rgba(248, 244, 235, 0.13);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.055);
}

.vps-panel-label {
  display: block;
  color: rgba(248, 244, 235, 0.52);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vps-panel-value {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vps-panel-section {
  margin-top: 12px;
  border: 1px solid rgba(248, 244, 235, 0.13);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.vps-panel-section h4 {
  margin: 0 0 10px;
  color: #f2ae58;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.vps-panel-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.vps-panel-section-head h4 {
  margin-bottom: 0;
}

.vps-panel-section-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.vps-panel-transfer-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: rgba(248, 244, 235, 0.8);
}

.vps-panel-progress-track {
  width: 100%;
  height: 9px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(248, 244, 235, 0.12);
}

.vps-panel-transfer-status {
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 700;
  color: rgba(248, 244, 235, 0.65);
}

.vps-panel-transfer-status[data-level="success"] {
  color: #7fb069;
}

.vps-panel-transfer-status[data-level="warn"] {
  color: #f2ae58;
}

.vps-panel-transfer-status[data-level="error"] {
  color: #f37d7d;
}

.vps-panel-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f2ae58 0%, #7fb069 100%);
  transition: width 180ms ease;
}

.vps-panel-tree-meta {
  margin: 8px 0 0;
  color: rgba(248, 244, 235, 0.7);
  font-size: 11px;
  line-height: 1.4;
}

.vps-panel-tree {
  margin-top: 8px;
  max-height: 250px;
  overflow: auto;
  border: 1px solid rgba(248, 244, 235, 0.12);
  border-radius: 10px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.22);
}

.vps-panel-tree-wrap[hidden] {
  display: none;
}

.vps-tree-node {
  margin: 0;
}

.vps-tree-node + .vps-tree-node {
  margin-top: 2px;
}

.vps-tree-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
}

.vps-tree-summary {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  cursor: pointer;
  list-style: none;
  min-height: 22px;
}

.vps-tree-summary::before {
  content: "▸";
  color: rgba(248, 244, 235, 0.76);
  font-size: 10px;
  line-height: 1;
}

.vps-tree-node[open] > .vps-tree-summary::before {
  content: "▾";
}

.vps-tree-summary::marker {
  content: "";
}

.vps-tree-summary::-webkit-details-marker {
  display: none;
}

.vps-tree-name {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #ebedef;
}

.vps-tree-size {
  grid-column: 3;
  flex-shrink: 0;
  color: rgba(248, 244, 235, 0.66);
  font: 11px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.vps-tree-row.is-file .vps-tree-name::before {
  content: "• ";
  color: rgba(248, 244, 235, 0.42);
}

.vps-tree-children {
  margin-top: 2px;
}

.vps-panel-actions,
.vps-panel-command-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vps-panel-btn {
  border: 1px solid rgba(248, 244, 235, 0.16);
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(248, 244, 235, 0.08);
  color: #f8f4eb;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.vps-panel-btn.is-primary {
  border-color: rgba(242, 174, 88, 0.6);
  background: #f2ae58;
  color: #111;
}

.vps-panel-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.vps-panel-output {
  min-height: 118px;
  max-height: 230px;
  overflow: auto;
  margin: 10px 0 0;
  border-radius: 12px;
  padding: 10px;
  background: #05080a;
  color: #dce8d9;
  font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
}

.vps-panel-log-line {
  display: inline;
  color: #c4d2df;
}

.vps-panel-log-entry {
  display: block;
}

.vps-panel-log-time {
  display: inline-block;
  width: 72px;
  margin-right: 10px;
  color: rgba(248, 244, 235, 0.48);
}

.vps-panel-log-line.is-command {
  color: #8ec5ff;
}

.vps-panel-log-line.is-info {
  color: #c4d2df;
}

.vps-panel-log-line.is-success {
  color: #7fb069;
}

.vps-panel-log-line.is-warn {
  color: #f2ae58;
}

.vps-panel-log-line.is-error {
  color: #f37d7d;
}

.vps-panel-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 8px;
}

.vps-panel-input {
  min-width: 0;
  border: 1px solid rgba(248, 244, 235, 0.14);
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(0, 0, 0, 0.22);
  color: #f8f4eb;
  font: 12px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (max-width: 680px) {
  .vps-panel-root {
    right: 10px;
    bottom: 10px;
  }

  .vps-panel-grid {
    grid-template-columns: 1fr;
  }
}
