:root {
  --green: #1f5c4a;
  --green-dark: #17463a;
  --green-soft: #e8f1ee;
  --ink: #17211e;
  --muted: #5f6b67;
  --line: #e2e6e4;
  --bg: #f7f8f7;
  --card: #fff;
  --red: #a4342a;
  --red-soft: #fbeceb;
  --amber: #8a5a00;
  --amber-soft: #fdf3dc;
  --radius: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 15px; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
h1 { font-size: 1.6rem; margin: 0 0 0.25rem; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1rem; margin: 0 0 0.25rem; }
p { margin: 0 0 0.75rem; }
a { color: var(--green); }
.muted { color: var(--muted); }
.small { font-size: 0.87rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; color: var(--muted); margin: 0 0 0.5rem; }

.top {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0 1.5rem; height: 56px;
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; color: var(--ink); text-decoration: none; }
.brand span { color: var(--green); }
#nav { display: flex; gap: 0.25rem; flex: 1; }
#nav a {
  padding: 0.4rem 0.75rem; border-radius: 6px; text-decoration: none; color: var(--muted); font-weight: 500;
}
#nav a:hover { background: var(--bg); color: var(--ink); }
#nav a.active { background: var(--green-soft); color: var(--green-dark); }
.badge {
  display: inline-block; min-width: 1.3em; padding: 0 0.4em; border-radius: 99px;
  background: var(--green); color: #fff; font-size: 0.75rem; text-align: center;
}
.who { font-size: 0.87rem; color: var(--muted); white-space: nowrap; }
.banner { background: var(--amber-soft); color: var(--amber); padding: 0.5rem 1.5rem; font-size: 0.87rem; }

main#view { max-width: 1040px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  padding: 0.5rem 0.9rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.btn:hover { border-color: #c5ccc9; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-dark); }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn:disabled { opacity: 0.55; cursor: default; }
button.link { font: inherit; background: none; border: 0; color: var(--green); cursor: pointer; padding: 0; text-decoration: underline; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 0.9rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.card p { margin: 0; }
.card .foot { margin-top: auto; padding-top: 0.5rem; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.meta { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.pill {
  display: inline-block; font-size: 0.78rem; font-weight: 500; padding: 0.1rem 0.55rem; border-radius: 99px;
  background: var(--bg); color: var(--muted); border: 1px solid var(--line); white-space: nowrap;
}
.pill.ok { background: var(--green-soft); color: var(--green-dark); border-color: transparent; }
.pill.bad { background: var(--red-soft); color: var(--red); border-color: transparent; }
.pill.wait { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.empty { border: 1px dashed #cfd6d3; border-radius: var(--radius); padding: 2rem; text-align: center; color: var(--muted); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.panel.accent { background: var(--green-soft); border-color: transparent; }
label { display: block; font-weight: 600; margin: 1rem 0 0.3rem; }
label .hint, .hint { font-weight: 400; color: var(--muted); font-size: 0.87rem; }
input[type='text'], textarea, select {
  width: 100%; font: inherit; color: inherit; padding: 0.55rem 0.7rem;
  border: 1px solid #cfd6d3; border-radius: 8px; background: #fff;
}
textarea { resize: vertical; min-height: 5rem; }
textarea.tall { min-height: 16rem; }
.checks { display: grid; gap: 0.3rem; max-height: 14rem; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.8rem; }
.checks label { font-weight: 400; margin: 0; display: flex; gap: 0.5rem; align-items: center; }
.error { color: var(--red); background: var(--red-soft); padding: 0.6rem 0.8rem; border-radius: 8px; }

table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: var(--bg); }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--bg); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.kv { border: 0; background: none; width: auto; }
.kv td { border: 0; padding: 0.15rem 0.8rem 0.15rem 0; }
.kv td:first-child { color: var(--muted); white-space: nowrap; }
code, pre { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85rem; }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 0.7rem; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0.4rem 0 0; max-height: 16rem; }

.report h1, .report h2, .report h3 { font-size: 1.05rem; margin: 1rem 0 0.4rem; }
.report > :first-child { margin-top: 0; }
.report table { margin: 0.5rem 0 1rem; }
.report ul { margin: 0 0 0.75rem; padding-left: 1.2rem; }
details { border-top: 1px solid var(--line); padding: 0.6rem 0; }
details:first-of-type { border-top: 0; }
summary { cursor: pointer; display: flex; gap: 0.6rem; align-items: center; }
.tabs { display: flex; gap: 0.25rem; margin-bottom: 1rem; }
.tabs button { font: inherit; font-weight: 600; background: none; border: 0; padding: 0.4rem 0.8rem; border-radius: 6px; color: var(--muted); cursor: pointer; }
.tabs button.active { background: var(--green-soft); color: var(--green-dark); }

dialog { border: 0; border-radius: 12px; padding: 1.5rem; max-width: 30rem; width: calc(100% - 2rem); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); }
dialog::backdrop { background: rgba(23, 33, 30, 0.45); }
dialog .row { justify-content: flex-end; margin-top: 1.25rem; }
#toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: 8px; z-index: 20; max-width: 90vw; }
#toast.bad { background: var(--red); }

body.login { display: grid; place-items: center; min-height: 100vh; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 2.5rem; max-width: 26rem; margin: 1rem; }
.login-card .btn { margin-top: 0.75rem; }

@media (max-width: 760px) {
  .top { flex-wrap: wrap; height: auto; padding: 0.6rem 1rem; gap: 0.5rem; }
  #nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .head { flex-direction: column; }
  table { display: block; overflow-x: auto; }
}
