:root {
  --bg: #f4f6f9;
  --card: #fff;
  --text: #1f2933;
  --muted: #6b7785;
  --line: #dde3ea;
  --primary: #2563c9;
  --primary-dark: #1d4fa3;
  --ok: #1f8a4c;
  --warn: #b7791f;
  --warn-bg: #fdf6e8;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 "Segoe UI", system-ui, sans-serif; }
button, input { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.topbar {
  display: flex; align-items: center; gap: 16px;
  height: 52px; padding: 0 24px; background: #1f2d3d; color: #fff;
}
.brand { font-weight: 600; font-size: 15px; }
.brand span { font-weight: 400; opacity: .7; }
.host { margin-left: auto; color: #cfd8e3; font-size: 13px; }

main { max-width: 1100px; margin: 0 auto; padding: 20px 24px 48px; }
h1 { margin: 0 0 4px; font-size: 22px; font-weight: 600; }
.lead { margin: 0; color: var(--muted); }

.toolbar { display: flex; align-items: center; gap: 10px; margin: 16px 0 14px; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; margin: 0; }
.search input {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 201, .15); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer;
}
.chip:hover { background: #eef2f7; }
.chip.on { background: #e8f0fb; border-color: #b9cff3; color: var(--primary-dark); font-weight: 600; }
.count { margin-left: auto; color: var(--muted); }

.recent { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 14px; }
.recent-label { color: var(--muted); font-size: 12px; }
.recent a {
  color: var(--text); text-decoration: none; background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; font-size: 13px;
}
.recent a:hover { border-color: var(--primary); color: var(--primary-dark); }

.group { margin-top: 8px; }
.group h2 { margin: 14px 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }

.card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 14px 12px;
}
.card.stopped { background: #fafbfc; }
.card-top { display: flex; align-items: center; gap: 8px; }
.card h3 { margin: 0; font-size: 16px; font-weight: 600; }
.badge {
  margin-left: auto; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px;
  background: #e8f6ee; color: var(--ok);
}
.badge.api { background: #eef2f7; color: #4b5b6e; }
.badge.stop { background: var(--warn-bg); color: var(--warn); }
.text { margin: 0; color: var(--muted); min-height: 1.45em; }
.hostline { margin: 0; font-family: Consolas, "Segoe UI Mono", monospace; font-size: 12px; color: #3d4d5e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alias { margin: 0; font-size: 12px; color: var(--muted); }
.actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 5px 12px; font-size: 13px; line-height: 18px; text-decoration: none;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); cursor: pointer;
}
.btn:hover { background: #eef2f7; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.empty { margin: 24px 0; color: var(--muted); }

@media (max-width: 640px) {
  .topbar, main { padding-left: 16px; padding-right: 16px; }
  .count { width: 100%; margin-left: 0; }
  .search { max-width: none; }
}
