:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --surface: #14181d;
  --surface-2: #1b2128;
  --border: #2a323d;
  --text: #e8edf3;
  --muted: #8b97a8;
  --accent: #5eead4;
  --accent-dim: #2dd4bf33;
  --danger: #f87171;
  --danger-dim: #f8717133;
  --warn: #fbbf24;
  --ok: #4ade80;
  --radius: 12px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, #12342f55, transparent 40%),
    radial-gradient(circle at top right, #1a274055, transparent 35%), var(--bg);
  color: var(--text);
}

.layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #14b8a6, #0f766e);
  box-shadow: var(--shadow);
}

h1 {
  margin: 0;
  font-size: 1.35rem;
}

h2 {
  margin: 0 0 14px;
  font-size: 0.95rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border);
}

.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.badge-running {
  color: var(--ok);
  background: #14532d44;
  border-color: #166534;
}

.badge-stopped {
  color: var(--danger);
  background: var(--danger-dim);
  border-color: #7f1d1d;
}

.badge-partial {
  color: var(--warn);
  background: #78350f44;
  border-color: #92400e;
}

.badge-unknown {
  color: var(--muted);
}

.btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover:not(:disabled) {
  border-color: #3d4a59;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: #115e59;
  border-color: #0f766e;
}

.btn-danger {
  background: #7f1d1d;
  border-color: #991b1b;
}

.btn-secondary {
  background: #1e3a5f;
  border-color: #1d4ed8;
}

.btn-ghost {
  background: transparent;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.82rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  min-height: 1.2em;
}

.details {
  margin: 0;
  display: grid;
  gap: 10px;
}

.details div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  align-items: start;
}

.details dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.details dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  word-break: break-all;
}

.logs-card {
  margin-bottom: 0;
}

.logs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.logs-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.logs {
  margin: 0;
  min-height: 280px;
  max-height: 420px;
  overflow: auto;
  background: #090b0d;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #c7d2de;
  white-space: pre-wrap;
  word-break: break-word;
}

.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .details div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
