:root {
  --bg: #f5f7fb;
  --card-bg: #ffffff;
  --border: #e0e4ee;
  --text-main: #111827;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --good: #16a34a;
  --ok: #f59e0b;
  --bad: #dc2626;
  --bar-neutral: #cbd5f5;
  --bar-nodata: #e5e7eb;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text-main);
  margin: 0;
  padding: 24px;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
}

h1 {
  margin-bottom: 12px;
}

.layout {
  max-width: 1100px;
  margin: 0 auto;
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 16px 20px 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.03);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.card-header h1 {
  font-size: 20px;
}

.card-header h2 {
  font-size: 18px;
}

.subtle-label {
  font-size: 13px;
  color: var(--text-muted);
}

#stream-url {
  text-decoration: none;
  color: inherit;
}
/* Uptime main card */

.uptime-main-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.uptime-main-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--good);
}

.uptime-subtext {
  font-size: 13px;
  color: var(--text-muted);
}

/* .uptime-bars-wrapper {
  background: #f3f4ff;
  border-radius: 10px;
  padding: 12px 10px;
  border: 1px solid #e0e7ff;
} */

.uptime-bars {
  display: flex;
  gap: 3px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.uptime-bar {
  flex: 1 1 auto;
  max-width: 12px;
  height: 32px;
  border-radius: 999px;
  background: var(--bar-neutral);
  position: relative;
}

.uptime-bar.nodata {
  background: #64788F;
}

.uptime-bar.good {
  background: rgba(22, 163, 74, 0.95);
}

.uptime-bar.ok {
  background: rgba(245, 158, 11, 0.95);
}

.uptime-bar.bad {
  background: rgba(220, 38, 38, 0.95);
}


/* Overall uptime tiles */

.uptime-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.uptime-tile {
  flex: 1 1 150px;
  min-width: 150px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f9fafb;
}

.uptime-tile-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.uptime-tile-value {
  font-size: 1.6rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}


.uptime-good {
  color: var(--good);
}

.uptime-bad {
  color: var(--bad);
}

/* Status card */

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
}

.status-ok { background: rgba(22, 163, 74, 0.12); color: var(--good); }
.status-silent { background: rgba(220, 38, 38, 0.12); color: var(--bad); }
.status-unknown { background: rgba(107, 114, 128, 0.16); color: var(--text-muted); }

.updated {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Status Tiles in Status Card */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.tile {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tile:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tile-value {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.tile-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Status Pill in Tile */
#status-tile .status-pill {
  font-size: 1.2rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  display: inline-block;
}

/* Events table */

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 13px;
}

th, td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  background: #f9fafb;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
}

tr:nth-child(even) td {
  background: #fdfdff;
}

.event-up {
  color: var(--good);
  font-weight: 600;
}

.event-down {
  color: var(--bad);
  font-weight: 600;
}

.center {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

/* Remove old settings styles */
.settings,
.setting,
.setting-label,
.setting-value {
  display: none;
}

@media (max-width: 700px) {
  body {
    padding: 12px;
  }
  .card {
    padding: 12px 12px 14px 12px;
  }
  .uptime-bars {
    gap: 2px;
  }
  .uptime-bar {
    height: 24px;
  }
}
