:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #1d2533;
  --muted: #657085;
  --line: #dbe2ee;
  --accent: #1268d6;
  --accent-strong: #0a4ea8;
  --good: #16834a;
  --bad: #b42318;
  --warn: #936a00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--text);
  background: var(--bg);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
}

#subtitle {
  margin-top: 6px;
  color: var(--muted);
}

.panel,
.metric {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgb(28 40 66 / 6%);
}

.panel {
  padding: 18px;
  margin-top: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric {
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.full {
  margin-top: 14px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  font: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(18 104 214 / 12%);
}

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  min-height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 650;
}

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

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

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

button.primary:hover {
  background: var(--accent-strong);
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-pill {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 12px;
  color: var(--muted);
  white-space: nowrap;
}

.status-pill.ok {
  color: var(--good);
  border-color: #b7e0ca;
  background: #effaf4;
}

.status-pill.bad {
  color: var(--bad);
  border-color: #ffd0ca;
  background: #fff3f1;
}

.output {
  min-height: 120px;
  max-height: 340px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 6px;
  background: #101828;
  color: #f2f4f7;
  font-size: 13px;
  line-height: 1.55;
}

.task-list,
.history-list {
  display: grid;
  gap: 10px;
}

.task-card,
.history-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcff;
}

.task-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.task-card strong {
  display: block;
}

.task-meta,
.history-card {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
}

.badge.good {
  color: var(--good);
  background: #eaf8f0;
}

.badge.bad {
  color: var(--bad);
  background: #fff0ed;
}

.badge.warn {
  color: var(--warn);
  background: #fff7df;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .topbar,
  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid.two,
  .metrics {
    grid-template-columns: 1fr;
  }

  .task-card {
    grid-template-columns: 1fr;
  }
}
