:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1d2330;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --ok: #16a34a;
  --err: #dc2626;
  --border: #e5e7eb;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
.topbar {
  display: flex; align-items: baseline; gap: 16px;
  padding: 18px 32px;
  background: #0f172a;
  color: #fff;
  border-bottom: 1px solid #1e293b;
}
.logo { font-weight: 700; font-size: 18px; letter-spacing: 0.3px; }
.subtitle { color: #94a3b8; font-size: 14px; }
main {
  max-width: 760px;
  margin: 24px auto;
  padding: 0 16px;
}
.stepper {
  display: flex; gap: 8px;
  margin-bottom: 24px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  overflow-x: auto;
}
.stepper span {
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--muted);
  white-space: nowrap;
}
.stepper span.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.stepper span.done {
  color: var(--ok);
}
.page {
  display: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 32px;
}
.page.active { display: block; }
h1 { margin: 0 0 16px; font-size: 22px; }
p, label { font-size: 15px; }
.muted { color: var(--muted); font-size: 13px; }
code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}
.buttons {
  display: flex; gap: 12px;
  margin-top: 24px;
  justify-content: flex-end;
}
button, .primary-link {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.primary, .primary-link {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
button.primary:hover, .primary-link:hover { background: var(--accent-dark); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Precheck */
.checks { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.check {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.check.ok { border-color: var(--ok); }
.check.bad { border-color: var(--err); }
.check-icon { font-size: 18px; }
.check.ok .check-icon { color: var(--ok); }
.check.bad .check-icon { color: var(--err); }
.check-title { font-weight: 500; }
.check-msg { font-size: 13px; color: var(--muted); }

/* Config form */
#config-form { display: flex; flex-direction: column; gap: 16px; }
#config-form label {
  display: flex; flex-direction: column; gap: 4px;
  font-weight: 500;
}
#config-form input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
#config-form input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }

/* Installing steps */
.steps { list-style: none; padding: 0; margin: 16px 0; }
.steps li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.steps li:last-child { border-bottom: none; }
.step-icon { font-size: 16px; min-width: 24px; line-height: 1.5; }
.step-title { font-weight: 500; }
.step-msg { font-size: 12px; color: var(--muted); margin-top: 2px; word-break: break-word; }
.step-pending .step-icon { color: var(--muted); }
.step-running .step-icon { color: var(--accent); animation: spin 1.2s linear infinite; }
.step-done    .step-icon { color: var(--ok); }
.step-skipped .step-icon { color: var(--muted); }
.step-failed  .step-icon { color: var(--err); }
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.progress {
  margin-top: 16px;
  background: var(--border);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* Done */
.next-link { margin: 20px 0; }

/* Error */
.error {
  background: #fef2f2;
  border: 1px solid var(--err);
  color: var(--err);
  padding: 12px;
  border-radius: 8px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  overflow-x: auto;
  white-space: pre-wrap;
}
