:root {
  --ok: #16a34a;
  --issue: #f59e0b;
  --down: #ef4444;
  --muted: #6b7280;
  --bg: #f8fafc;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
}

body {
  margin: 18px;
  background: var(--bg);
}

h1 {
  margin: 0 0 6px 0;
}

.summary {
  color: #111827;
  margin-bottom: 12px;
}

.filters {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0 14px;
}

#q {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

#refresh {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: white;
  cursor: pointer;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  vertical-align: top;
}

thead th {
  background: #f8fafc;
  color: #374151;
  font-weight: 600;
}

.badge {
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
}

.badge.ok {
  background: var(--ok);
}

.badge.issue {
  background: var(--issue);
}

.badge.down {
  background: var(--down);
}

.tags {
  color: #374151;
  font-size: 12px;
}

.time {
  color: #334155;
  font-size: 12px;
}

.meta {
  color: #64748b;
  font-size: 12px;
}

.btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
}

.btn[disabled] {
  opacity: .5;
  cursor: not-allowed;
}

.btn.primary {
  background: #111827;
  color: #fff;
}

pre.log {
  background: #0b1020;
  color: #d1d5db;
  padding: 10px;
  border-radius: 8px;
  max-height: 240px;
  overflow: auto;
}

.input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .35);
}

.modal.hidden {
  display: none;
}

.modal__dialog {
  width: min(640px, 94vw);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

.modal__head, .modal__foot {
  padding: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
}

.modal__foot {
  border-top: 1px solid #e5e7eb;
  border-bottom: none;
}

.modal__body {
  padding: 12px;
}

.modal__title {
  font-weight: 700;
}

.link {
  color: #2563eb;
  text-decoration: underline;
  cursor: pointer;
  font-size: 12px;
}

/* ---- service status icons ---- */
.svc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.svc-item {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.25;
}

.svc-name {
  color: #111827;
}

.svc-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: #cbd5e1;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}

.svc-dot.ok {
  background: var(--ok);
}

/* active   = 緑 */
.svc-dot.inactive {
  background: #94a3b8;
}

.svc-dot.issue {
  background: var(--issue);
}


/* inactive = グレー */
.svc-dot.failed {
  background: var(--down);
}

/* failed   = 赤 */
.svc-dot.activating {
  background: #22c55e;
  animation: pulse 1.4s infinite;
}

/* 起動中 */
.svc-dot.deactivating {
  background: #f59e0b;
  animation: pulse 1.4s infinite;
}

/* 停止中 */
.svc-dot.unknown {
  background: #9ca3af;
}

/* unknown  = 灰 */
@keyframes pulse {
  0% {
    opacity: .45;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: .45;
  }
}

/* ---- disk usage bars ---- */
.disk-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.disk-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.disk-bar-wrap {
  position: relative;
  flex: 0 0 var(--diskbar-w, 100px);
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.disk-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--ok);
  transition: width .25s ease;
}

.disk-bar-fill.warn {
  background: var(--issue);
}

.disk-bar-fill.bad {
  background: var(--down);
}

.disk-bar-fill.na {
  background: #cbd5e1;
}

.disk-bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #bbb;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}

.disk-mount {
  font-size: 13px;
  color: #111827;
}

/* 高CPUの視覚強調（外縁のリング） */
.svc-dot.highcpu {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .15), 0 0 0 5px rgba(245, 158, 11, .35);
}