* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: #06060f; color: #eee; font-family: 'Segoe UI', sans-serif; }
body { min-height: 100vh; padding: 16px 12px 32px; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
header h1 {
  font-size: clamp(0.95rem, 3vw, 1.2rem);
  color: #a8dadc;
  letter-spacing: 0.03em;
}
.updated { font-size: 0.74rem; color: #666688; }

main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 620px) {
  main { grid-template-columns: 1fr; }
}

/* 카드 */
.card {
  border-radius: 14px;
  padding: 14px 16px 12px;
  background: #0c0c1e;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.elec   { border-color: #00e5ff33; box-shadow: 0 0 18px #00e5ff18; }
.gas    { border-color: #ff6d0033; box-shadow: 0 0 18px #ff6d0018; }
.server { border-color: #60a5fa33; box-shadow: 0 0 18px #60a5fa18; grid-column: 1 / -1; }
@media (max-width: 620px) { .server { grid-column: 1; } }

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon { font-size: 1.1rem; }
.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #aac;
  flex: 1;
}
.detail-link {
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  padding: 4px 14px;
  border-radius: 20px;
  border: 1.5px solid;
  transition: background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.elec .detail-link {
  color: #00e5ff;
  border-color: #00e5ff66;
  box-shadow: 0 0 8px #00e5ff33;
}
.elec .detail-link:hover {
  background: #00e5ff22;
  box-shadow: 0 0 14px #00e5ff66;
}
.gas .detail-link {
  color: #ff6d00;
  border-color: #ff6d0066;
  box-shadow: 0 0 8px #ff6d0033;
}
.gas .detail-link:hover {
  background: #ff6d0022;
  box-shadow: 0 0 14px #ff6d0066;
}
.server .detail-link {
  color: #60a5fa;
  border-color: #60a5fa66;
  box-shadow: 0 0 8px #60a5fa33;
}
.server .detail-link:hover {
  background: #60a5fa22;
  box-shadow: 0 0 14px #60a5fa66;
}
@media (min-width: 621px) {
  .detail-link { font-size: 0.9rem; padding: 5px 18px; }
}

/* 모바일: 그래프 높이 50% */
@media (max-width: 620px) {
  .spark { height: 168px; }
}

/* 메트릭 */
.metrics {
  display: flex;
  gap: 6px;
}
.metric {
  flex: 1;
  background: #10102a;
  border-radius: 10px;
  padding: 8px 6px 6px;
  text-align: center;
}
.val {
  font-size: clamp(1.05rem, 3.5vw, 1.45rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 4px;
  white-space: nowrap;
}
.lbl { font-size: 0.6rem; color: #446; }

/* 형광 색상 + 글로우 */
.cyan   { color: #00e5ff; text-shadow: 0 0 8px #00e5ff, 0 0 20px #00e5ff66; }
.green  { color: #39ff14; text-shadow: 0 0 8px #39ff14, 0 0 20px #39ff1466; }
.purple { color: #d966ff; text-shadow: 0 0 8px #d966ff, 0 0 20px #d966ff66; }
.orange { color: #ff6d00; text-shadow: 0 0 8px #ff6d00, 0 0 20px #ff6d0066; }
.yellow { color: #ffe000; text-shadow: 0 0 8px #ffe000, 0 0 20px #ffe00066; }
.pink   { color: #ff4081; text-shadow: 0 0 8px #ff4081, 0 0 20px #ff408166; }

/* 디바이스 행 (전기만) */
.devices {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.dev {
  font-size: 0.72rem;
  font-weight: 600;
  background: #10102a;
  border-radius: 20px;
  padding: 3px 10px;
}

/* 스파크라인 — margin-top:auto로 두 카드의 0선 위치 일치 */
.spark {
  width: 100%;
  height: 336px;
  display: block;
  border-radius: 6px;
  margin-top: auto;
}
