:root {
  --bg: #f6f5f2;
  --panel: #ffffff;
  --text: #1d1d1b;
  --muted: #6b6a66;
  --line: #dcdad4;
  --accent: #2f5d8a;
  --accent-text: #ffffff;
  --done: #2e7d4f;
  --failed: #b3261e;
  --code: #efede8;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171716;
    --panel: #22221f;
    --text: #ecebe6;
    --muted: #a3a29c;
    --line: #3a3935;
    --accent: #7fb0e0;
    --accent-text: #10161c;
    --done: #6cc28f;
    --failed: #f08a80;
    --code: #2c2c28;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 system-ui, "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

header,
main {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px;
}

header {
  padding-top: 24px;
}

h1 {
  font-size: 24px;
  margin: 0 0 8px;
}

h2 {
  font-size: 17px;
  margin: 0 0 8px;
}

section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}

section.done {
  border-left-color: var(--done);
}

section.done h2::after {
  content: " ✓";
  color: var(--done);
}

section.failed {
  border-left-color: var(--failed);
}

code,
kbd,
.cmd {
  background: var(--code);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
}

.cmd {
  display: block;
  padding: 8px;
  white-space: pre-wrap;
  word-break: break-all;
  user-select: all;
}

button {
  font: inherit;
  padding: 6px 14px;
  margin: 4px 8px 4px 0;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: progress;
}

button.quiet,
.ops button {
  background: transparent;
  color: var(--accent);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
}

label {
  display: block;
  margin: 8px 0;
  color: var(--muted);
}

select,
input[type="text"],
textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
}

.drop {
  border: 2px dashed var(--line);
  border-radius: 8px;
  padding: 28px 16px;
  margin: 8px 0;
  text-align: center;
  color: var(--muted);
}

.drop.over {
  border-color: var(--accent);
  color: var(--accent);
}

.ops li {
  margin-bottom: 10px;
}

.out {
  margin: 8px 0 0;
  max-height: 220px;
  overflow: auto;
  font-size: 12px;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-all;
}

.out:empty {
  display: none;
}

progress {
  display: block;
  width: 100%;
}

.muted {
  color: var(--muted);
}

.warn {
  color: var(--failed);
  font-weight: 600;
}

/* The frame from the other site only has to exist; it stays on screen so that it is not paused. */
#box {
  width: 1px;
  height: 1px;
  border: 0;
  position: absolute;
  left: 0;
  bottom: 0;
}

[hidden] {
  display: none !important;
}
