body.firmware-mode [hidden] { display: none !important; }
body.firmware-mode .shell { max-width: 1100px; }
.fw-intro { margin: 4px 0 18px; }
.fw-page > .section-title { margin: 22px 0 8px; }
.fw-page > .section-title:first-child { margin-top: 0; }
.hint { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.fw-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.panel > .fw-row:first-child,
.panel > .empty:first-child { border-top: none; }
.fw-name { font-weight: 700; }
.fw-version {
  font-family: var(--mono);
  font-size: 13px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fw-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.fw-meta a { font-weight: 600; }
.pill {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: #e9f2ff;
  color: var(--accent);
}
.pill.test { background: #f1f2f4; color: #44546f; }
.notes { margin: 6px 0 0; white-space: pre-wrap; }
.sha {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
details.more { grid-column: 1 / -1; }
details.more summary {
  cursor: pointer;
  color: var(--muted);
  min-height: 32px;
  display: flex;
  align-items: center;
}
.older {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.older .title { font-weight: 600; }
.fw-page .empty { padding: 16px; color: var(--muted); }
.publish {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}
.publish h2 { margin: 0 0 12px; font-size: 16px; }
.publish .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.field.tight { margin-top: 0; }
.field label { font-size: 13px; font-weight: 600; }
.drop {
  margin-top: 12px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg);
  text-align: center;
  cursor: pointer;
}
.drop.hover { border-color: var(--accent); background: #e9f2ff; }
.actions { display: flex; gap: 8px; margin-top: 12px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%) translateY(12px);
  background: #1f2328;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: 0.15s ease;
  max-width: min(520px, calc(100% - 24px));
  z-index: 20;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }
dialog { border: none; border-radius: 8px; padding: 0; max-width: 420px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(23, 43, 77, 0.45); }
.dialog-inner { padding: 16px; }
.dialog-inner h2 { margin: 0 0 4px; font-size: 16px; }
.dialog-inner p { margin: 0; color: var(--muted); }
@media (max-width: 700px) {
  .fw-row, .publish .grid, .older { grid-template-columns: 1fr; display: grid; }
  .fw-row button, .older button { justify-self: start; }
}
