:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #18212f;
  --muted: #637083;
  --line: #e2e6ec;
  --brand: #1f3a5f;
  --brand-2: #2d5a8f;
  --accent: #e8f0fa;
  --good: #1a7f4b;
  --good-bg: #e6f5ec;
  --warn: #9a6400;
  --warn-bg: #fdf3dd;
  --bad: #b42318;
  --bad-bg: #fde8e6;
  --radius: 10px;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; }
h1, h2 { margin: 0; }
h1 { font-size: 18px; }
h2 { font-size: 15px; margin-bottom: 12px; }
small { color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px; background: var(--brand); color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand p { margin: 2px 0 0; font-size: 12.5px; opacity: .8; }
.logo {
  width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  background: #fff; color: var(--brand); font-weight: 800; font-size: 18px;
}
.mode-banner {
  background: var(--warn-bg); color: var(--warn); padding: 6px 12px; border-radius: 6px; font-size: 12.5px;
  max-width: 520px;
}

.layout {
  display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px;
  padding: 20px 24px; align-items: start;
}
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; } }
.side, .main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; }

.field { display: flex; flex-direction: column; gap: 5px; margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.field > span, legend { font-weight: 600; font-size: 13px; padding: 0; margin-bottom: 5px; }
input[type=text], input[type=number], input[type=date], input[type=search], textarea, select {
  font: inherit; color: inherit; border: 1px solid #cfd6df; border-radius: 7px; padding: 7px 9px; background: #fff;
  min-width: 0;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.platforms { display: flex; flex-direction: column; gap: 6px; }
.platform {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px;
  cursor: pointer;
}
.platform:hover { background: #fafbfc; }
.platform .name { font-weight: 600; }
.platform .note { color: var(--muted); font-size: 11.5px; display: block; }
.platform .grow { flex: 1; min-width: 0; }

.badge { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.badge.live, .badge.done { background: var(--good-bg); color: var(--good); }
.badge.web { background: #e7effb; color: #1f4f8f; }
.badge.demo, .badge.partial, .badge.running, .badge.queued { background: var(--warn-bg); color: var(--warn); }
.badge.not_configured, .badge.failed { background: var(--bad-bg); color: var(--bad); }

.check { display: flex; align-items: baseline; gap: 7px; margin-bottom: 8px; flex-wrap: wrap; }
.check small { flex-basis: 100%; margin-left: 22px; margin-top: -2px; }

button { font: inherit; cursor: pointer; border-radius: 7px; padding: 8px 14px; border: 1px solid transparent; }
button:disabled { opacity: .5; cursor: default; }
.primary { background: var(--brand); color: #fff; font-weight: 600; }
.primary:hover:not(:disabled) { background: var(--brand-2); }
.secondary { background: #fff; border-color: #cfd6df; color: var(--ink); }
.secondary:hover:not(:disabled) { background: #f3f5f8; }
.link { background: none; border: 0; padding: 0; color: var(--brand-2); font-size: 12.5px; }
#run { width: 100%; margin-top: 6px; padding: 10px; }
.error { color: var(--bad); background: var(--bad-bg); padding: 8px 10px; border-radius: 7px; margin: 6px 0; }

.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow: auto; }
.history li {
  border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; cursor: pointer; display: flex; gap: 8px;
}
.history li.active { border-color: var(--brand-2); background: var(--accent); }
.history .grow { flex: 1; min-width: 0; }
.history .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history .meta { font-size: 12px; color: var(--muted); }
.history .actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.summary.empty { color: var(--muted); }
.summary-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.summary-head h2 { margin: 0; }
.summary .terms { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-top: 12px; }
.note-box { border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; font-size: 12.5px; }
.note-box strong { display: block; margin-bottom: 3px; }
.note-box ul { margin: 0; padding-left: 16px; color: var(--muted); }
.note-box.bad { border-color: #f3c3bd; background: #fffafa; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters .inline { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.filters .spacer { flex: 1; }
#f-q { width: 170px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f7f9fb; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfd; }
td.nowrap { white-space: nowrap; }
.caption-col { min-width: 280px; }
.caption { max-width: 460px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.author { color: var(--muted); font-size: 12px; margin-top: 3px; }
td a { color: var(--brand-2); text-decoration: none; font-weight: 600; }
td a:hover { text-decoration: underline; }
.pill { font-size: 11.5px; padding: 2px 7px; border-radius: 5px; background: #eef1f5; white-space: nowrap; }
.rel { font-size: 12px; white-space: nowrap; }
.rel.yes { color: var(--good); }
.rel.no { color: var(--bad); }
.rel.unk { color: var(--muted); }
.demo-tag { font-size: 10.5px; font-weight: 700; color: var(--warn); background: var(--warn-bg); padding: 1px 5px; border-radius: 4px; margin-left: 4px; }

.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.pager button { margin-left: 6px; }
