*,
*::before,
*::after {
  box-sizing: border-box;
}

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

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header h1 {
  margin: 0;
  font-size: 1.7rem;
}

.header p {
  margin: 0.25rem 0 0;
  color: #64748b;
  font-size: 0.95rem;
}

.health {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
}

.health.ok {
  background: #bbf7d0;
}

.health.error {
  background: #fecaca;
}

.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 800px) {
  .main {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.card {
  background: white;
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.card-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.small {
  font-size: 0.8rem;
  color: #94a3b8;
}

.list {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.3rem;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.list-item:last-child {
  border-bottom: none;
}

.city-name,
.district-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.weather-meta,
.closing-detail,
.badge,
.timestamp {
  font-size: 0.8rem;
}

.weather-meta {
  color: #64748b;
}

.badge {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: #e5e7eb;
}

.badge.status-Closed {
  background: #fecaca;
}

.badge.status-Delay,
.badge.status-Delayed {
  background: #fef3c7;
}

.badge.status-Open {
  background: #bbf7d0;
}

.value-large {
  font-weight: 700;
  font-size: 1.1rem;
}

.timestamp {
  color: #94a3b8;
  margin-top: 0.15rem;
  text-align: right;
}

.controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.controls input {
  flex: 1;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #cbd5f1;
  font-size: 0.9rem;
}

.controls button {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: none;
  font-size: 0.85rem;
  background: #2563eb;
  color: white;
  cursor: pointer;
}

.controls button:hover {
  background: #1d4ed8;
}

.footer {
  padding: 0.75rem 1rem 1.25rem;
  text-align: center;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: auto;
}

/* Closings details / sources */

.list-item-closings {
  flex-direction: column;
}

.sources-wrapper {
  margin-top: 0.4rem;
  border-top: 1px dashed #e2e8f0;
  padding-top: 0.4rem;
}

.sources-toggle {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  color: #2563eb;
  cursor: pointer;
}

.sources-toggle:hover {
  text-decoration: underline;
}

.sources-details {
  margin-top: 0.3rem;
}

.sources-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sources-list li {
  font-size: 0.78rem;
  padding: 0.25rem 0;
}

.sources-header-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.1rem;
}

.source-pill {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: #e5e7eb;
  font-weight: 500;
}

.source-time {
  color: #94a3b8;
}

.source-status {
  color: #475569;
}

.source-link {
  display: inline-block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
}

/* Radar & Alerts */

.card-wide {
  grid-column: 1 / -1;
}

.radar-alerts-layout {
  display: grid;
  gap: 1rem;
}

@media (min-width: 900px) {
  .radar-alerts-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
  }
}

.radar-block h3,
.alerts-block h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}

.radar-caption {
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: #94a3b8;
}

.alerts-list {
  max-height: 260px;
}

.alert-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.alert-item:last-child {
  border-bottom: none;
}

.alert-headline {
  font-size: 0.9rem;
  font-weight: 600;
}

.alert-meta {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.1rem;
}

.alert-description {
  font-size: 0.78rem;
  color: #475569;
  margin-top: 0.25rem;
}

.alert-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.75rem;
  margin-right: 0.35rem;
}

.alert-badge-Severe,
.alert-badge-Extreme {
  background: #fecaca;
}

.alert-badge-Moderate {
  background: #fee2e2;
}

.alert-badge-Minor {
  background: #e0f2fe;
}

.alert-badge-Unknown {
  background: #e5e7eb;
}

/* Radar map */

.radar-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.radar-header-row h3 {
  margin: 0;
  font-size: 0.95rem;
}

#radar-city-select {
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #cbd5f5;
  background: #f8fafc;
}

.radar-map {
  width: 100%;
  height: 260px;
  border-radius: 0.75rem;
  overflow: hidden;
  margin-top: 0.3rem;
}

.leaflet-container {
  font: inherit;
}
