body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 480px;
  /* leave a small margin on both sides so the page looks like a tile */
  width: calc(100% - 32px);
  margin: 40px auto;
  background: #ffffff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  text-align: center;
}

h1 {
  margin-bottom: 20px;
}

.details {
  margin-top: 20px;
  font-size: 14px;
  text-align: left;
}

.gauge-container {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto;
}

.gauge-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.gauge-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.gauge-center .label {
  display: block;
  font-size: 14px;
  color: #666;
}

.gauge-center .value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #222;
}

.details table {
  width: 100%;
  border-collapse: collapse;
}

.details th, .details td {
  padding: 6px 8px;
  border-bottom: 1px solid #eee;
  text-align: left;
}

.details th {
  width: 40%;
  color: #555;
  font-weight: 600;
}

/* Small gray text for update timestamp under the main timestamp */
.update-timestamp {
  display: block;
  color: #777;
  font-size: 11px;
  margin-top: 4px;
  line-height: 1.1;
  font-weight: 400;
}

/* Small gray label displayed under the main left-hand label */
.update-label {
  display: block;
  color: #777;
  font-size: 11px;
  font-weight: 400;
  margin-top: 4px;
}

/* Mobile optimizations */
@media (max-width: 600px) {
  /* Add a small page padding so the white tile doesn't touch the device edges */
  body {
    padding-left: 5px;
    padding-right: 5px;
    box-sizing: border-box;
    overflow-x: hidden; /* prevent horizontal scrolling on small rounding issues */
  }

  .container {
    /* Fill the available area inside the page padding so a visible gap remains */
    width: 100%;
    max-width: calc(100% - 10px);
    box-sizing: border-box;
    margin: 6px auto;
    padding: 12px;
    border-radius: 10px;
  }

  .gauge-container {
    width: 100%;
    max-width: 340px;
    aspect-ratio: 1 / 1;
    height: auto;
    margin: 0 auto 8px auto;
  }

  .gauge-container canvas {
    aspect-ratio: 1 / 1;
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
  }

  .gauge-center .value {
    display: block;
    font-size: 20px; /* increase size for readability on mobile */
  }

  .gauge-center .value:first-child {
    font-size: 22px;
    font-weight: 700;
  }
  .gauge-center .value:nth-child(2) {
    font-size: 14px;
    font-weight: 600;
    color: #444;
  }

  .details {
    font-size: 14px;
  }

  .details th, .details td {
    padding: 8px 6px;
  }

  .details th {
    width: 40%;
    vertical-align: top;
    font-size: 13px;
  }

  .update-timestamp {
    font-size: 11px;
    color: #888;
    margin-top: 6px;
  }

  .update-label {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
  }

  /* Make table rows a bit more touch-friendly */
  .details table tr { line-height: 1.4; }
}
