:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5d6b7c;
  --line: #dde2e8;
  --accent: #1f5fbf;
  --accent-text: #ffffff;
  --ok: #1d7a46;
  --warn: #a15c00;
  --bad: #b3261e;
  --radius: 8px;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
a { color: var(--accent); }
header.top {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  align-items: center;
}
header.top .brand { font-weight: 700; margin-right: auto; text-decoration: none; color: var(--text); }
header.top nav { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; }
header.top nav a { text-decoration: none; padding: 0.2rem 0; }
header.top nav a.current { font-weight: 700; border-bottom: 2px solid var(--accent); }
header.top form { margin: 0; }
main { max-width: 1100px; margin: 0 auto; padding: 1rem; }
main.narrow { max-width: 420px; }
h1 { font-size: 1.5rem; margin: 0.4rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 0.6rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
.banner { padding: 0.6rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.banner.info { background: #e7f0fd; border: 1px solid #b9d2f6; }
.banner.warn { background: #fff4e0; border: 1px solid #f0cf94; }
.banner.bad { background: #fde9e7; border: 1px solid #f2b8b3; }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  /* A shadow on the side where more of a wide table can be scrolled to. */
  background:
    linear-gradient(to right, var(--surface) 30%, rgba(255, 255, 255, 0)) 0 0,
    linear-gradient(to left, var(--surface) 30%, rgba(255, 255, 255, 0)) 100% 0,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0)) 0 0,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0)) 100% 0;
  background-repeat: no-repeat;
  background-size: 2.5rem 100%, 2.5rem 100%, 0.9rem 100%, 0.9rem 100%;
  background-attachment: local, local, scroll, scroll;
  background-color: var(--surface);
}
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.85rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
label { display: block; font-weight: 600; margin: 0.7rem 0 0.25rem; }
label.inline { display: inline-flex; gap: 0.4rem; align-items: center; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: #fff;
}
td select, td input { min-width: 7rem; }
textarea { min-height: 6rem; font-family: inherit; }
textarea.code { font-family: ui-monospace, Menlo, monospace; font-size: 0.9rem; }
.hint { color: var(--muted); font-size: 0.88rem; margin: 0.2rem 0 0; }
button, .button {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  margin-top: 0.8rem;
}
button.secondary, .button.secondary { background: var(--surface); color: var(--accent); }
button.danger { background: var(--bad); border-color: var(--bad); }
button.small, .button.small { padding: 0.25rem 0.6rem; margin-top: 0; font-size: 0.9rem; }
button.link { background: none; border: none; color: var(--accent); padding: 0; margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 1rem; }
.row > * { flex: 1 1 240px; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.actions form { margin: 0; }
.tag { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.82rem; background: #eceff3; white-space: nowrap; }
.tag.ok { background: #e0f3e8; color: var(--ok); }
.tag.warn { background: #fff0d6; color: var(--warn); }
.tag.bad { background: #fde3e1; color: var(--bad); }
.muted { color: var(--muted); }
.breakable { overflow-wrap: anywhere; }
pre { white-space: pre-wrap; word-break: break-word; background: #f1f3f6; padding: 0.7rem; border-radius: 6px; margin: 0; font-size: 0.88rem; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 0.35rem 0; }
input[type=date], input[type=time], input[type=datetime-local] { width: 100%; padding: 0.5rem 0.6rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; }
fieldset.group { border: 1px solid var(--line); border-radius: var(--radius); margin: 1rem 0 0; padding: 0.2rem 0.9rem 0.9rem; }
fieldset.group legend { font-weight: 600; padding: 0 0.3rem; }
.field-label { font-weight: 600; margin: 0.7rem 0 0.25rem; }
.field-error { color: var(--bad); font-size: 0.9rem; margin: 0.2rem 0 0; }
[aria-invalid=true] { border-color: var(--bad) !important; }
.field-table .table-wrap { margin-bottom: 0.4rem; }
.field-table td input[type=checkbox] { min-width: 0; }
progress { width: 100%; height: 0.9rem; accent-color: var(--accent); }
.run-progress .run-state { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; align-items: center; margin: 0 0 0.6rem; }
.run-progress .run-step { font-weight: 600; }
@media (max-width: 640px) {
  main { padding: 0.7rem; }
  /* A wide table keeps readable columns and scrolls sideways. */
  .table-wrap table.wide { min-width: 44rem; }
  h1 { font-size: 1.3rem; }
  th, td { padding: 0.45rem 0.5rem; }
}
