/* Deliberately plain. The form is the only part that gets any attention. */

:root {
  --fg: #1c2024;
  --muted: #6b7280;
  --line: #d7dbe0;
  --bg: #f6f7f9;
  --accent: #0b5fff;
  --error: #b42318;
  --ok: #067647;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
}

.bar {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card, details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
}

summary { cursor: pointer; font-weight: 600; }

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 4px; }

.lede { margin: 0 0 16px; color: var(--muted); }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

/* ---- form ---- */

.field { margin-bottom: 16px; }

label { display: block; font-weight: 600; margin-bottom: 4px; }

.req { color: var(--error); }

input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="file"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  background: #fff;
  color: inherit;
}

input:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

input[aria-invalid="true"] { border-color: var(--error); }

.checkline {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.checkline label { font-weight: 400; margin: 0; }
.checkline input[type="checkbox"] { margin-top: 4px; flex: none; }

.hint { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.error {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--error);
  min-height: 0;
}
.error:empty { display: none; }

button {
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button.secondary {
  background: #fff;
  color: var(--fg);
  border-color: var(--line);
  font-weight: 400;
}

button[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- settings grid ---- */

.grid { display: grid; grid-template-columns: 1fr; gap: 4px; margin-top: 12px; }
.grid > .hint { margin-bottom: 10px; }
.actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }

/* ---- steps ---- */

.steps { list-style: none; padding: 0; margin: 0 0 12px; }

.steps li {
  padding: 4px 0 4px 22px;
  position: relative;
  color: var(--muted);
}

.steps li::before {
  content: "○";
  position: absolute;
  left: 0;
}

.steps li[data-state="active"] { color: var(--fg); font-weight: 600; }
.steps li[data-state="active"]::before { content: "◐"; }
.steps li[data-state="done"] { color: var(--ok); }
.steps li[data-state="done"]::before { content: "●"; }
.steps li[data-state="failed"] { color: var(--error); }
.steps li[data-state="failed"]::before { content: "✕"; }
.steps li[data-state="skipped"] { text-decoration: line-through; }

progress { width: 100%; height: 10px; }

#upload-progress-wrap, #scan-progress-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
#upload-progress-wrap progress, #scan-progress-wrap progress { flex: 1; }

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; margin: 0 0 16px; }
.kv dt { font-weight: 600; }
.kv dd { margin: 0; }

/* ---- log ---- */

.log {
  list-style: none;
  margin: 0 0 12px;
  padding: 8px;
  max-height: 320px;
  overflow-y: auto;
  background: #fbfbfc;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

.log li { padding: 2px 0; border-bottom: 1px solid #eef0f2; white-space: pre-wrap; word-break: break-word; }
.log li:last-child { border-bottom: 0; }
.log li[data-level="error"] { color: var(--error); }
.log li[data-level="ok"] { color: var(--ok); }
