.sidebar {
  background: linear-gradient(#191919, #101010);
  border-radius: 6px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.side-btn {
  border: none;
  background-color: transparent;
  cursor: pointer;

  display: flex;
  flex-direction: column;
  align-items: center;

  background-repeat: no-repeat;
  background-position: top center;
  background-size: 32px 32px;

  width: 90px;
  padding-top: 34px;
}

.side-btn .label {
  margin-top: 2px;
  font-size: 10px;
  color: #ff3b3b;
  text-align: center;
  line-height: 1.15;
}

.side-btn.auto {
  background-image: url("/website/images/4545auto.png");
}
.side-btn.auto:hover {
  background-image: url("/website/images/4545auto_hover.png");
}
.side-btn.auto:active {
  background-image: url("/website/images/4545auto_click.png");
}

.side-btn.man {
  background-image: url("/website/images/4545man.png");
}
.side-btn.man:hover {
  background-image: url("/website/images/4545man_hover.png");
}
.side-btn.man:active {
  background-image: url("/website/images/4545man_click.png");
}

*:focus { outline: none; }

.logo img {
  width: 85px;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #eaeaea;
  cursor: default;
  user-select: none;
}

button { cursor: pointer; }

.window {
  width: 560px;
  margin: 8px auto;
  background: linear-gradient(#1c1c1c, #0e0e0e);
  box-shadow: 0 24px 70px rgba(0,0,0,.85);
  border-radius: 6px;
  overflow: hidden;
}

.titlebar {
  background: linear-gradient(#2c2c2c, #1b1b1b);
  padding: 3px;
  text-align: center;
  font-size: 12px;
  color: #cfd6ff;
  border-bottom: 1px solid #333;
}

.content {
  padding: 8px 10px;
}

.logo {
  text-align: center;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 4px;
}

.logo span { color: #e11d2e; }

.connect-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-bottom: 6px;
}

.panel {
  background: radial-gradient(circle at top, #202020, #121212);
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05),
              0 4px 12px rgba(0,0,0,.6);
}

.device-header {
  display: grid;
  grid-template-columns: 110px 1fr 1fr 24px;
  align-items: center;
  font-size: 12px;
}

.usb {
  display: flex;
  align-items: center;
  gap: 6px;
}

.usb-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 5px #22c55e;
}

.refresh {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid #e11d2e;
  color: #e11d2e;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.refresh:hover { background: rgba(225,29,46,.15); }

.update-title {
  text-align: center;
  font-size: 13px;
  margin: 4px 0 4px;
}

.main {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
}

.sidebar div {
  margin: 4px 0;
  font-size: 11px;
  color: #ff3b3b;
}

.firmware-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.firmware-panel {
  background: linear-gradient(#1a1a1a, #0f0f0f);
  border-radius: 6px;
  padding: 6px 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05),
              0 4px 10px rgba(0,0,0,.65);
}

.firmware-badge {
  display: inline-block;
  background: #b91c1c;
  padding: 1px 7px;
  font-size: 10px;
  margin-bottom: 4px;
}

.firmware-badge.secondary {
  background: #333;
  color: #ccc;
}

.fw-header,
.fw-row {
  display: grid;
  grid-template-columns: 70px 1fr 90px 90px 70px;
  align-items: center;
  font-size: 11px;
}

.fw-header {
  color: #aaa;
  border-bottom: 1px solid #333;
  padding-bottom: 2px;
}

.fw-row {
  padding: 3px 0;
  border-bottom: 1px solid #222;
}

.fw-note {
  color: #ff3b3b;
  font-size: 11px;
  margin-top: 3px;
  margin-left: 16px;
}

.fw-select {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 11px;
  color: #ccc;
  cursor: pointer;
}

.fw-select input[type="radio"] {
  accent-color: #e11d2e;
  cursor: pointer;
}

.view-btn {
  background: #111;
  border: 1px solid #444;
  color: #fff;
  padding: 2px 7px;
  font-size: 11px;
}

.view-btn:hover { border-color: #e11d2e; }

.manual-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 6px;
  font-size: 12px;
}

.manual-row input[type="file"] { font-size: 11px; }

.conn-status {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10px;
}

.conn-status.disconnected { background: #442222; color: #ffb3b3; }
.conn-status.connected    { background: #224422; color: #aaffaa; }

.progress-wrap {
  margin: 4px 8px;
  height: 6px;
  background: #222;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: #16a34a;
  transition: width 0.1s linear;
}

#logBox {
  margin: 4px 8px 6px;
  background: #000;
  color: #ff3b3b;
  padding: 5px;
  height: 70px;
  overflow-y: auto;
  border-radius: 5px;
  font-size: 10px;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.update-btn {
  margin-top: 6px;
  padding: 7px;
  background-color: rgb(180, 0, 0);
  text-align: center;
  font-size: 15px;
  letter-spacing: 1.2px;
  border-radius: 5px;
  box-shadow: 0 0 18px rgba(255,0,0,.35);
  cursor: pointer;
}

.update-btn:hover {
  background-color: rgb(255, 0, 0);
}

.update-btn:active {
  transform: scale(0.97);
}

.update-btn.busy { opacity: .6; pointer-events: none; }

.update-btn.disabled {
  background-color: #555;
  box-shadow: none;
  color: #999;
  cursor: not-allowed;
  pointer-events: none;
}

.progress-panel {
  margin-top: 6px;
  background: linear-gradient(#1a1a1a, #0f0f0f);
  border-radius: 6px;
  padding: 4px 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05),
              0 4px 10px rgba(0,0,0,.65);
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 8px;
}

.log-toggle {
  background: #111;
  border: 1px solid #444;
  color: #fff;
  padding: 2px 7px;
  font-size: 10px;
  border-radius: 4px;
}

.log-toggle:hover { border-color: #e11d2e; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: none;
  align-items: center;
  justify-content: center;
}

.modal {
  width: 560px;
  background: linear-gradient(#1e1e1e, #0f0f0f);
  border: 1px solid #444;
  box-shadow: 0 18px 50px rgba(0,0,0,.9);
}

.modal-titlebar {
  background: linear-gradient(#2c2c2c, #1b1b1b);
  padding: 5px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.modal-titlebar span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-close {
  cursor: pointer;
  font-size: 16px;
}

.modal-content {
  padding: 10px;
}

.modal-table {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 5px;
  font-size: 11px;
}

.modal-header {
  color: #aaa;
  border-bottom: 1px solid #333;
  padding-bottom: 3px;
}

.modal-desc {
  border-top: 1px solid #333;
  margin-top: 6px;
  padding-top: 6px;
  font-size: 11px;
}

/* ---------- Skeleton loaders ---------- */
.skeleton {
  display: inline-block;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.10) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 3px;
  vertical-align: middle;
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Skeleton badge — mimics the red/gray "Latest Firmware" badge */
.skeleton-badge {
  display: inline-block;
  width: 90px;
  height: 14px;
  border-radius: 2px;
  margin-bottom: 4px;
  background: linear-gradient(
    90deg,
    rgba(185, 28, 28, 0.35) 0%,
    rgba(185, 28, 28, 0.55) 50%,
    rgba(185, 28, 28, 0.35) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.skeleton-badge.secondary {
  background: linear-gradient(
    90deg,
    rgba(70, 70, 70, 0.4) 0%,
    rgba(110, 110, 110, 0.6) 50%,
    rgba(70, 70, 70, 0.4) 100%
  );
  background-size: 200% 100%;
}

/* Text skeletons sized to match the real fw-row columns */
.skeleton-text      { height: 10px; width: 70%;  border-radius: 2px; }
.skeleton-text.sm   { width: 40%; }
.skeleton-text.md   { width: 60%; }
.skeleton-text.lg   { width: 80%; }

/* Button skeleton — matches the "View" button size */
.skeleton-btn {
  width: 44px;
  height: 18px;
  border-radius: 3px;
}

/* Radio skeleton */
.skeleton-radio {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* Keeps the skeleton fw-row using the same grid as the real one */
.fw-row.is-skeleton > div,
.fw-row.is-skeleton > .skeleton-btn {
  padding-right: 6px;
}

.skeleton-select {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
}