:root {
  --bg: #12151a;
  --panel: #1a1f27;
  --line: #2c333e;
  --text: #e6e9ee;
  --muted: #8b95a5;
  --accent: #2f6df6;
  --ok: #4ec07a;
  --warn: #e0a33c;
  --error: #e2645d;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6f8;
    --panel: #ffffff;
    --line: #e0e3e8;
    --text: #1b1f26;
    --muted: #667085;
    --accent: #2f6df6;
    --ok: #1a8a4a;
    --warn: #9a6b12;
    --error: #b6332c;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 2rem 1rem 4rem;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

main {
  max-width: 44rem;
  margin: 0 auto;
}

h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}

.sub,
.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.sub {
  margin: 0 0 2rem;
}

section {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.row {
  display: flex;
  gap: 0.5rem;
}

input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

button {
  padding: 0.6rem 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: var(--accent);
}

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

.primary {
  padding: 0.8rem 1.6rem;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
}

.link {
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  font-size: 0.85rem;
}

.status {
  margin: 0.9rem 0 0;
  min-height: 1.5em;
  font-size: 0.95rem;
}

.status.ok {
  color: var(--ok);
}

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

/* Live progress from the worker, newest at the bottom. */
.steps {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.counts {
  margin: 0 0 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.manifest {
  margin: 0;
  padding: 0;
  list-style: none;
}

.row-inner {
  display: grid;
  /* Fixed mark and name columns keep the marks aligned down the left edge and
     the dates aligned regardless of title length. */
  grid-template-columns: 1.4rem minmax(0, 1fr) 7rem;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.4rem 0.5rem;
  border-radius: 5px;
  color: inherit;
  text-decoration: none;
}

a.row-inner:hover {
  background: var(--panel);
}

.mark {
  font-weight: 700;
  text-align: center;
}

.name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.when {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

/* The note wraps under the name rather than squeezing the grid. */
.note {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 0.82rem;
}

.created .mark {
  color: var(--ok);
}
.updated .mark {
  color: var(--accent);
}
.archived .mark,
.failure .mark {
  color: var(--error);
}
.warning .mark {
  color: var(--warn);
}

.empty {
  padding: 0.4rem 0.5rem;
  color: var(--muted);
}

.artifact {
  margin-top: 1rem;
  font-size: 0.85rem;
}

a {
  color: var(--accent);
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}
