:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #595959;
  --surface: #f2f2f2;
  --hover: #e5e5e5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 15px/1.55 system-ui, sans-serif;
}

.shell {
  width: min(100% - 48px, 960px);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
}

.site-header strong { font-size: 20px; }

main { padding-block: 30px 64px; }

h1, h2 { margin: 0; line-height: 1.2; }
h1 { font-size: clamp(32px, 6vw, 44px); letter-spacing: -.045em; }
h2 { font-size: 25px; letter-spacing: -.025em; }

#login { max-width: 350px; margin: 36px auto 0; }
#loginform { display: grid; gap: 16px; margin-top: 26px; }
#loginform button { justify-self: start; }

#message { margin: 0 0 16px; color: var(--muted); }
#message:empty { display: none; }

#workspace > section + section { margin-top: 48px; }

#projectform {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  align-items: end;
  gap: 12px;
  margin: 24px 0;
}

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

input, button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  font: inherit;
}

input {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface);
  color: var(--ink);
  caret-color: var(--ink);
}

button {
  padding: 9px 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button:hover { background: #333; }
button:disabled { opacity: .55; cursor: wait; }
button.secondary, button.danger { background: transparent; color: var(--ink); }
button.secondary:hover, button.danger:hover { background: var(--hover); }
button.danger { color: var(--muted); }

:focus-visible {
  outline: 2px solid #595959;
  outline-offset: 2px;
}

.sectionhead, .project {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.project {
  padding: 14px 16px;
  margin-top: 8px;
  background: var(--surface);
  border-radius: 6px;
}

.project > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.project p { margin: 2px 0 0; color: var(--muted); }
.project p:empty { display: none; }
#projects > p { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 4px; }

.tablewrap { margin-top: 10px; overflow-x: auto; }
table { width: 100%; min-width: 500px; border-collapse: collapse; text-align: left; }
th, td { padding: 9px 12px; }
th { color: var(--muted); font-weight: 500; font-size: 14px; }
tbody tr:nth-child(odd) { background: var(--surface); }
.status { white-space: nowrap; }
.status.failed { font-weight: 650; }

pre {
  overflow: auto;
  max-height: 420px;
  padding: 16px;
  background: var(--surface);
  border-radius: 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 13px/1.6 ui-monospace, Consolas, monospace;
}

[hidden] { display: none !important; }

@media (max-width: 640px) {
  .shell { width: calc(100% - 32px); }
  .site-header { min-height: 64px; }
  main { padding-top: 20px; }
  #projectform { grid-template-columns: 1fr; }
  #projectform button { justify-self: start; }
  .project { flex-direction: column; align-items: flex-start; }
  table { min-width: 0; font-size: 13px; }
  th, td { padding-inline: 5px; }
  th { font-size: 12px; }
  td:nth-child(2) { overflow-wrap: anywhere; }
  td button { padding-inline: 5px; }
}
