:root {
  --bg: #F7F4EE;
  --surface: #FFFDF8;
  --border: #E0DACF;
  --text: #2B2F26;
  --muted: #6A6E63;
  --accent: #2F5D3A;
  --accent-text: #FFFDF8;
  --ok: #2F5D3A;
  --warn: #8A5A00;
  --danger: #9B2C2C;
  --focus: #1F4E8C;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Atkinson Hyperlegible", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}

main { max-width: 860px; margin: 0 auto; padding: 24px 16px 40px; }
h1 { font-size: 28px; margin: 0 0 8px; line-height: 1.2; }
h2 { font-size: 20px; margin: 32px 0 8px; }
h3 { font-size: 16px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
a { color: var(--accent); }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg); padding: 1px 4px; border-radius: 3px; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 13px; margin-top: 4px; }
.wrap { overflow-wrap: anywhere; }

.bar { background: var(--surface); border-bottom: 1px solid var(--border); }
.bar-inner { max-width: 860px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: center; margin-left: auto; }
.nav a { color: var(--text); }

.foot { max-width: 860px; margin: 0 auto; padding: 0 16px 32px; color: var(--muted); font-size: 13px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 16px; margin: 0 0 16px; }
.table-wrap { overflow-x: auto; margin: 0 0 16px; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

.form label { display: block; font-weight: 700; margin: 12px 0 4px; }
.form input[type=hidden] + label { margin-top: 0; }
.form label.choice { display: inline-block; font-weight: 400; margin-right: 20px; }
input[type=text], input[type=password], input[type=date], select, textarea {
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
}
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 12px 0; }
legend { font-weight: 700; padding: 0; margin-bottom: 4px; }
.row { display: flex; flex-wrap: wrap; gap: 0 16px; }
.row > div { flex: 1 1 160px; }

.btn {
  display: inline-block;
  padding: 8px 16px;
  font: inherit;
  font-weight: 700;
  color: var(--accent-text);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  margin-top: 8px;
}
.btn-quiet { color: var(--text); background: var(--surface); border-color: var(--border); }
.btn-small { padding: 3px 10px; margin-top: 0; font-size: 14px; }
.btn:hover { filter: brightness(0.95); }
.link { font: inherit; color: var(--text); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.inline { display: inline; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
td.actions { display: table-cell; white-space: nowrap; }
td.actions > * { margin: 2px 4px 2px 0; }

.notice { padding: 10px 14px; border: 1px solid var(--border); border-left-width: 4px; border-radius: 4px; background: var(--surface); margin: 0 0 16px; }
.notice-ok { border-left-color: var(--ok); }
.notice-warn { border-left-color: var(--warn); }
.notice-error { border-left-color: var(--danger); }

.lead { font-size: 17px; }
.lead.ok { color: var(--ok); }
.lead.warn { color: var(--warn); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 20px; margin: 0 0 12px; }
.facts dt { color: var(--muted); font-weight: 700; }
.facts dd { margin: 0; }
.steps { margin: 0 0 12px; padding-left: 22px; }
.notes { margin: 0 0 12px; padding-left: 22px; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--border); font-size: 13px; font-weight: 700; background: var(--bg); }
.badge-ready { color: var(--ok); border-color: var(--ok); }
.badge-failed { color: var(--danger); border-color: var(--danger); }
.badge-running { color: var(--focus); border-color: var(--focus); }
.badge-queued, .badge-cancelled, .badge-expired { color: var(--muted); }

progress { width: 100%; height: 14px; accent-color: var(--accent); }

.nowrap, table.compact td, table.compact th { white-space: nowrap; }

@media (max-width: 560px) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; }
  table.stack tr { padding: 8px 0; border-bottom: 1px solid var(--border); }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td { border: 0; padding: 2px 12px; }
  table.stack td.actions { padding-top: 6px; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 8px; }
  h1 { font-size: 24px; }
}
