query('SELECT COUNT(*) FROM recliner_presets')->fetchColumn(); echo json_encode([ 'status' => 'ok', 'database' => 'connected', 'preset_count' => $count, 'timestamp_utc' => gmdate('c'), ], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); } catch (Throwable $e) { http_response_code(500); echo json_encode([ 'status' => 'error', 'message' => 'Health check failed.', 'timestamp_utc' => gmdate('c'), ], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); }