* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f1115;
  color: #e8e8e8;
  margin: 0;
  padding: 2rem 1rem;
  display: flex;
  justify-content: center;
}

main {
  width: 100%;
  max-width: 480px;
}

h1 {
  margin-bottom: 0.25rem;
}

.subtitle {
  color: #9a9a9a;
  font-size: 0.9rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

#add-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

#new-title {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  border: 1px solid #333;
  background: #1a1d24;
  color: #e8e8e8;
  font-size: 1rem;
}

button {
  padding: 0.6rem 1rem;
  border-radius: 6px;
  border: none;
  background: #4f7cff;
  color: white;
  font-size: 1rem;
  cursor: pointer;
}

button:hover {
  background: #3d68e8;
}

#task-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.task {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 6px;
  background: #1a1d24;
  margin-bottom: 0.5rem;
}

.task.done .title {
  text-decoration: line-through;
  color: #777;
}

.task .title {
  flex: 1;
}

.task button.delete {
  background: transparent;
  color: #ff6b6b;
  padding: 0.25rem 0.5rem;
}

.task button.delete:hover {
  background: #2a1a1a;
}

.empty-state {
  color: #777;
  text-align: center;
  margin-top: 2rem;
}

.status-panel {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: #1a1d24;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 100;
}

.status-item {
  padding: 0.2rem 0;
}

.status-item + .status-item {
  margin-top: 0.15rem;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #555; /* unknown/loading state until the first /status call resolves */
  flex-shrink: 0;
}

.status-dot.ok {
  background: #3ecf6d;
  box-shadow: 0 0 6px rgba(62, 207, 109, 0.6);
}

.status-dot.down {
  background: #ff5c5c;
  box-shadow: 0 0 6px rgba(255, 92, 92, 0.6);
}

.status-subrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 2px 0 0 1.25rem; /* aligns under the label, past the dot */
}

.status-detail {
  font-size: 0.7rem;
  color: #888;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sparkline {
  line-height: 0; /* prevents the inline svg from adding baseline gap */
  flex-shrink: 0;
}

.sparkline svg polyline {
  stroke: #4f7cff;
}

.uptime-bar {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 16px;
  margin-top: 0.6rem;
  overflow-x: hidden;
}

.uptime-block {
  width: 4px;
  height: 100%;
  border-radius: 1px;
  background: #333; /* no data yet for this slot */
  flex-shrink: 0;
}

.uptime-block.ok {
  background: #3ecf6d;
}

.uptime-block.down {
  background: #ff5c5c;
}

.status-footer {
  font-size: 0.65rem;
  color: #666;
  text-align: center;
  margin-top: 0.35rem;
}

@media (max-width: 600px) {
  .status-panel {
    position: static;
    margin: 0 auto 1.5rem;
    width: fit-content;
  }
}
