*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3e;
  --accent: #5b6af0;
  --text: #e2e4f0;
  --muted: #7b7f9e;
  --ok: #3ecf8e;
  --error: #f25f5c;
  --unknown: #4a4d65;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
header {
  border-bottom: 1px solid var(--border);
  padding: 20px 32px;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 900px;
  margin: 0 auto;
}

.logo { width: 2.2rem; height: 2.2rem; border-radius: 8px; object-fit: cover; flex-shrink: 0; }

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
  font-family: monospace;
}

/* ── Main ── */
main {
  flex: 1;
  padding: 36px 32px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* ── Cards ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: border-color 0.15s, transform 0.1s;
}

.card:not(.no-link):hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  cursor: pointer;
}

.card.no-link { cursor: default; }

.card-icon { font-size: 1.75rem; flex-shrink: 0; line-height: 1; }

.service-icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 7px;
  display: block;
  object-fit: cover;
}

.card-body { flex: 1; min-width: 0; }

.card-body h2 {
  font-size: 1rem;
  font-weight: 600;
}

.card-body p {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 3px;
}

.port {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.72rem;
  font-family: monospace;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--muted);
}

/* ── Status dot ── */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--unknown);
  flex-shrink: 0;
  transition: background 0.3s;
}

.status-dot.ok    { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.status-dot.error { background: var(--error); box-shadow: 0 0 6px var(--error); }

/* ── Footer ── */
footer {
  margin-top: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

#refresh-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 8px;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 0.15s;
}

#refresh-btn:hover { border-color: var(--accent); color: var(--text); }

@media (max-width: 520px) {
  header, main { padding-left: 16px; padding-right: 16px; }
}
