body {
  font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto,
    Ubuntu, sans-serif;
  padding: 0;
  margin: 0;
  line-height: 1.4;
}

.content {
  max-width: 600px;
  margin: 0 auto;
  padding: 12px;
}

h1 {
  margin: 0 0 0.35em;
  font-size: 1.75rem;
  font-weight: 600;
}

h2 {
  margin-top: 2em;
  margin-bottom: 0.5em;
  font-size: 1.1rem;
  font-weight: 600;
}

.tagline {
  margin: 0 0 1.5em;
  color: inherit;
  opacity: 0.85;
}

a {
  color: #03a9f4;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 1.5em 0 0.75em;
}

button,
.file-btn {
  appearance: none;
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  padding: 0.5em 1em;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  color: inherit;
  cursor: pointer;
}

button:hover:not(:disabled),
.file-btn:hover {
  filter: brightness(0.95);
}

button:disabled,
.file-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.secondary {
  background: transparent;
}

button.danger {
  border-color: #c62828;
  background: #c62828;
  color: #fff;
}

button.danger:hover:not(:disabled) {
  filter: brightness(1.08);
}

.danger-row {
  margin-top: 0.25em;
}

dialog {
  max-width: 28rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font: inherit;
  line-height: 1.45;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

dialog h2 {
  margin: 0 0 0.75em;
  font-size: 1.15rem;
}

dialog p {
  margin: 0 0 0.75em;
}

dialog p:last-of-type {
  margin-bottom: 1.25em;
}

dialog .button-row {
  margin: 0;
  justify-content: flex-end;
}

input[type="file"] {
  display: none;
}

.meta {
  font-size: 0.9rem;
  opacity: 0.85;
  margin: 0.5em 0;
}

.status-line {
  text-align: center;
  margin: 0.25em 0 1em;
  font-size: 0.9rem;
}

#status {
  opacity: 0.85;
}

#status.ok {
  opacity: 1;
}

.steps {
  margin: 0;
  padding-left: 1.25rem;
}

.steps li + li {
  margin-top: 0.35em;
}

code {
  font-size: 0.9em;
}

#progress-wrap {
  display: none;
  margin: 1em 0;
}

#progress-wrap.active {
  display: block;
}

progress {
  width: 100%;
  height: 1em;
}

#progress-label {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 0.35em;
  text-align: center;
}

.log-section {
  width: min(1100px, calc(100vw - 24px));
  margin-left: 50%;
  transform: translateX(-50%);
}

.log-section h2 {
  margin-top: 2em;
}

.content pre {
  max-width: 100%;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-height: 120px;
  max-height: 240px;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.footer {
  margin-top: 24px;
  border-top: 1px solid #ccc;
  padding-top: 24px;
  text-align: center;
  font-size: 0.95rem;
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #333;
    color: #fff;
  }

  a {
    color: #58a6ff;
  }

  button,
  .file-btn {
    border-color: #555;
    background: #444;
    color: #fff;
  }

  button.secondary {
    background: transparent;
  }

  button.danger {
    border-color: #e53935;
    background: #e53935;
    color: #fff;
  }

  dialog {
    border-color: #555;
    background: #333;
    color: #fff;
  }

  .content pre {
    border-color: #555;
    background: #2a2a2a;
  }

  .footer {
    border-top-color: #555;
  }
}
