:root {
  --bg: #0b1220;
  --bg-clear: #22345c;
  --panel: #131c2e;
  --panel-2: #1a2740;
  --text: #e6ecf5;
  --muted: #93a1bd;
  --border: #24324f;
  --ok: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --accent: #3b82f6;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-clear);
  color: var(--text);
  line-height: 1.5;
  transition: background-color 0.8s ease;
}

body.outage-active {
  background-color: var(--bg);
}

.wrap {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  padding: 32px 0 8px;
}

.site-header h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
}

main { padding: 20px 0 40px; }

.banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 1.15rem;
  font-weight: 600;
}

.banner__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.banner--ok { border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.08); }
.banner--ok .banner__dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15); }

.banner--warn { border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.08); }
.banner--warn .banner__dot { background: var(--warn); box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15); }

.banner--bad { border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.08); }
.banner--bad .banner__dot { background: var(--bad); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15); }

.banner--error { border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.06); }
.banner--error .banner__dot { background: var(--bad); }

.meta {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.panel {
  margin-top: 26px;
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel__head h2 { margin: 0; }

.range {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.range select {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filter-input {
  flex: 1 1 240px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
}

.filter-input::placeholder { color: var(--muted); }

.filter-input:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-count {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.empty {
  color: var(--muted);
  margin: 6px 0;
}

.current-group + .current-group {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.current-group__title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.current-group--unplanned .current-group__title { color: #fca5a5; }

.outage {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  margin-bottom: 10px;
}

.outage:last-child { margin-bottom: 0; }

.outage__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.outage__title {
  font-weight: 600;
  margin: 0;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge--active { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.badge--cleared { background: rgba(34, 197, 94, 0.16); color: #86efac; }
.badge--planned { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
.badge--scheduled { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
.badge--ongoing { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.badge--done { background: rgba(147, 161, 189, 0.18); color: #cbd5e1; }

.outage__link { color: var(--accent); text-decoration: none; }
.outage__link:hover { text-decoration: underline; }

.outage__meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.outage__desc {
  margin: 8px 0 0;
  font-size: 0.9rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 0 40px;
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer p { margin: 4px 0; }

.outage--clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.outage--clickable:hover,
.outage--clickable:focus-visible {
  border-color: var(--accent);
  background: #1f2f4d;
  outline: none;
}

.outage__hint {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--accent);
}

.map-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.map-overlay[hidden] { display: none; }

.map-overlay__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.map-overlay__title {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.back-button {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  flex: 0 0 auto;
}

.back-button:hover { border-color: var(--accent); }

.map-canvas {
  flex: 0 0 auto;
  height: min(50vh, 460px);
  margin: 16px 20px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.leaflet-container { background: #0b1220; font-family: inherit; }

.map-info {
  flex: 0 1 auto;
  margin: 16px 20px 20px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.9rem;
  max-height: 40vh;
  overflow-y: auto;
}

.map-info p { margin: 6px 0; }
.map-info strong { color: var(--text); font-weight: 600; }

.outage-marker { background: transparent; border: none; }

.outage-marker__inner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #fde68a, #f59e0b);
  border: 2px solid #0b1220;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}
