:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111;
  background: #f6f7f8;
}

body {
  margin: 0;
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

h1 {
  margin: 0;
  font-size: 2rem;
}

p {
  margin: 0.25rem 0 0;
  color: #555;
}

.status-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.pill {
  padding: 0.6rem 0.8rem;
  border-radius: 999px;
  background: #ddd;
  font-weight: 800;
  white-space: nowrap;
}

.pill.ok {
  background: #d6f5d6;
  color: #14532d;
}

.pill.error {
  background: #ffd6d6;
  color: #7f1d1d;
}

.live-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  padding: 0.85rem 1rem;
  min-width: 0;
}

.card.compact {
  padding: 0.7rem 1rem;
}

.label {
  display: block;
  color: #666;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}

th {
  background: #1f2937;
  color: white;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

tr:last-child td {
  border-bottom: none;
}

.call {
  font-weight: 800;
  letter-spacing: 0.04em;
}

.legend {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  color: #444;
}

.swatch {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: 4px;
  margin-left: 0.4rem;
}

.swatch.darkgreen { background: #006400; }
.swatch.lightgreen { background: #90ee90; }
.swatch.orange { background: #ffb35c; }
.swatch.red { background: #800000; }

@media (max-width: 1100px) {
  .live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 950px) {
  main { padding: 1rem; }
  header { align-items: flex-start; flex-direction: column; }
  .status-wrap { align-items: flex-start; }
  table { display: block; overflow-x: auto; }
}

@media (max-width: 620px) {
  .live-grid { grid-template-columns: 1fr; }
}
