* {
  box-sizing: border-box;
}

:root {
  --bg: #08111f;
  --panel: #0f172a;
  --panel2: #111c31;
  --border: #243047;
  --text: #eef5ff;
  --muted: #9fb0c7;
  --normal: #16a34a;
  --degraded: #f59e0b;
  --outage: #dc2626;
  --pge: #ff6b00;
  --blue: #38bdf8;
}

/* IMPORTANT: Remove #app from height:100% */
html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Header */
.topbar {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 100%;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #0b1220, #10213a);
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-img {
  height: 60px;
  width: auto;
}

.board-layout {
    display: grid;
    grid-template-columns: 75% 25%;
    height: calc(100vh - 120px);
}

#map {
    height: 100%;
}

.outage-panel {
    overflow-y: auto;
    padding: 1rem;
}

.brand-text {
  text-align: left;
}

.eyebrow {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1 {
  margin: 4px 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
}

.support-info {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  text-align: right;
  font-size: 0.9rem;
}

.support-info p {
  margin: 2px 0;
}

/* Intro text */
.intro-text {
  text-align: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.intro-text p {
  margin: 0;
  color: var(--muted);
}

/* Legend */
.legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 20px;
  color: var(--muted);
  font-size: 14px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend i {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
}

.normal {
  background: var(--normal);
}

.degraded {
  background: var(--degraded);
}

.outage {
  background: var(--outage);
}

.pge {
  background: var(--pge);
}

/* Summary Cards */
.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 16px 28px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}

.card strong {
  display: block;
  font-size: 28px;
}

.card span {
  color: var(--muted);
  font-size: 14px;
}

/* Main Layout */
.layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 16px;
  padding: 0 28px 28px;
  min-height: 700px;
}

.panel {
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
}

.map-wrap {
  min-height: 700px;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 700px;
}

/* Forms */
label {
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
}

input,
button {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 11px 12px;
  outline: none;
}

input {
  width: 100%;
  background: #08111f;
  color: var(--text);
}

input:focus {
  border-color: var(--blue);
}

button {
  background: #2563eb;
  color: white;
  font-weight: 800;
  cursor: pointer;
  border: 0;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.hint {
  font-size: 12px;
  line-height: 1.35;
}

/* Area List */
.area-list {
  margin-top: 12px;
  display: grid;
  gap: 6px;
  max-height: 255px;
  overflow: auto;
  padding-right: 4px;
}

.area-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: var(--panel2);
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
}

.area-item:hover {
  border-color: var(--blue);
}

.badge {
  color: white;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

.details h2 {
  margin: 0 0 8px;
}

.result {
  margin-top: 12px;
  padding: 12px;
  background: #08111f;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.hidden {
  display: none;
}

/* MapLibre Popup */
.maplibregl-popup-content {
  background: #0f172a;
  color: #eef5ff;
  border: 1px solid #243047;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .4);
}

/* Footer */
.site-footer {
  margin-top: 20px;
  padding: 20px;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  background: #0b1220;
}

.site-footer div {
  margin: 4px 0;
}

/* Mobile */
@media (max-width: 900px) {

  .topbar {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  .support-info {
    position: static;
    transform: none;
    text-align: center;
  }

  .summary {
    grid-template-columns: repeat(2, 1fr);
    padding: 14px 18px;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 0 18px 18px;
    min-height: auto;
  }

  .panel {
    order: 2;
  }

  .map-wrap {
    order: 1;
    height: 60vh;
    min-height: 450px;
  }

  #map {
    height: 60vh;
  }
}

.subscribe-card {
    margin: 16px 28px;
    padding: 20px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.subscribe-card h2 {
    margin-top: 0;
}

.subscribe-form {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 10px;
    margin-top: 14px;
}

#subscribeResult {
    margin-top: 12px;
    color: var(--blue);
    font-weight: 600;
}

@media (max-width: 900px) {

    .subscribe-form {
        grid-template-columns: 1fr;
    }

}

.alert-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.alert-card {
  background: #09152f;
  border: 1px solid #1d3557;
  border-radius: 12px;
  padding: 20px;
}

.alert-card h3 {
  margin-top: 0;
}

.alert-card input {
  width: 100%;
  margin-bottom: 10px;
}

.alert-card button {
  margin-bottom: 10px;
}

@media (max-width: 900px) {
  .alert-panels {
    grid-template-columns: 1fr;
  }
}
