:root {
  --bg: #0f1115;
  --card: #181b22;
  --fg: #e7e9ee;
  --muted: #9aa3b2;
  --accent: #5b8cff;
  --ok: #3fb950;
  --err: #f85149;
  --line: #2a2f3a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 460px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
}

h1 { margin: 0; font-size: 1.5rem; }
.sub { margin: 2px 0 22px; color: var(--muted); }

.field { display: block; margin-bottom: 18px; }
.field span { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 9px 11px;
  background: #0f1218;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--fg);
  font: inherit;
  font-size: 0.85rem;
}

.versions {
  display: flex;
  gap: 12px;
  margin-bottom: 6px;
}
.versions > div {
  flex: 1;
  background: #0f1218;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.versions .k { display: block; font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.versions span:last-child { font-weight: 600; }

.notes { color: var(--muted); font-size: 0.85rem; min-height: 1em; margin: 8px 2px 16px; }

.actions { display: flex; flex-direction: column; gap: 10px; }
button {
  appearance: none;
  border: 0;
  border-radius: 9px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 600;
  color: white;
  background: var(--accent);
  cursor: pointer;
}
button:disabled { opacity: 0.5; cursor: default; }
button#prepareBtn, button#flashBtn { background: #2c5cdd; }

.progress {
  margin-top: 18px;
  background: #0f1218;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 28px;
  position: relative;
  overflow: hidden;
}
.bar { height: 100%; width: 0; background: var(--accent); transition: width 0.15s ease; }
.plabel {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 0.78rem; color: var(--fg);
}

.status { white-space: pre-wrap; margin-top: 18px; min-height: 1.2em; }
.status.ok { color: var(--ok); }
.status.error { color: var(--err); }

.help { margin-top: 22px; color: var(--muted); font-size: 0.85rem; }
.help summary { cursor: pointer; }
.help ol { padding-left: 1.2em; }
