@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap");

:root {
  --bg: #08060f;
  --bg-alt: #0d0b1a;
  --surface: #171335;
  --surface-2: #1d1840;
  --surface-glass: rgba(31, 25, 60, 0.62);
  --border: #332c5c;
  --border-soft: #282353;
  --border-bright: rgba(167, 139, 250, 0.35);

  --purple: #7c3aed;
  --purple-dark: #5b21b6;
  --purple-deep: #6d28d9;
  --violet: #a78bfa;
  --violet-light: #c084fc;
  --cyan: #06b6d4;
  --cyan-light: #60a5fa;

  --text: #f6f4fd;
  --text-dim: #bcb6da;
  --text-faint: #948dc0;

  --green: #22c55e;
  --green-dark: #16a34a;
  --yellow: #fbbf24;
  --orange: #f97316;
  --red: #ef4444;
  --gray: #322c56;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px -16px rgba(0, 0, 0, 0.55);

  --font-heading: "Space Grotesk", "DM Sans", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scrollbar-color: var(--border) transparent;
}

::selection {
  background: rgba(124, 58, 237, 0.35);
  color: #fff;
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 8px;
  border: 3px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--purple);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
}

/* Ambient background: drifting aurora blobs + a faint dot grid */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-fx::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(167, 139, 250, 0.16) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%);
  opacity: 0.5;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}

.blob-1 {
  width: 620px;
  height: 620px;
  top: -220px;
  left: -120px;
  background: radial-gradient(circle at 30% 30%, var(--purple), transparent 70%);
  animation: drift1 26s ease-in-out infinite;
}

.blob-2 {
  width: 560px;
  height: 560px;
  top: -160px;
  right: -180px;
  background: radial-gradient(circle at 60% 40%, var(--violet), transparent 70%);
  animation: drift2 32s ease-in-out infinite;
}

.blob-3 {
  width: 480px;
  height: 480px;
  bottom: -220px;
  left: 30%;
  background: radial-gradient(circle at 50% 50%, var(--violet-light), transparent 70%);
  opacity: 0.32;
  animation: drift3 38s ease-in-out infinite;
}

@keyframes drift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.08); }
}

@keyframes drift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, 60px) scale(1.05); }
}

@keyframes drift3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
  .blob-1, .blob-2, .blob-3 { animation: none; }
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  margin: 0;
  letter-spacing: -0.01em;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
}

.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border-soft);
  background: rgba(8, 6, 15, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18.5px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.brand-mark {
  height: 32px;
  width: auto;
  flex-shrink: 0;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  color: var(--text-dim);
}

.header-links a {
  text-decoration: none;
  transition: color 0.15s ease;
}

.header-links a:hover {
  color: var(--violet-light);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-bright);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.16), rgba(6, 182, 212, 0.1));
  font-size: 12.5px;
  color: var(--text);
  font-weight: 500;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Hero */
.hero {
  padding: 68px 0 30px;
  text-align: center;
  position: relative;
}

.hero .eyebrow {
  /* inline-block (not inline-flex) so long text actually wraps on narrow
     screens instead of forcing a single-line min-content width - flex
     items default to min-width:auto, which silently overflows text. */
  display: inline-block;
  max-width: 100%;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--violet-light);
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid var(--border-bright);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: 52px;
  font-weight: 700;
  line-height: 1.05;
  background: linear-gradient(120deg, #ffffff 20%, var(--violet-light) 60%, var(--cyan-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin: 14px auto 0;
  color: var(--text-dim);
  font-size: 17px;
  max-width: 480px;
}

/* Overall status banner */
.overall-banner {
  margin-top: 36px;
  border-radius: var(--radius);
  padding: 26px 30px;
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid var(--border-bright);
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  animation: fadeInUp 0.6s var(--ease) both;
}

.overall-banner .ob-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 26px;
}

.overall-banner .ob-text {
  text-align: left;
}

.overall-banner .ob-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
}

.overall-banner .ob-sub {
  color: var(--text-dim);
  font-size: 13.5px;
  margin-top: 3px;
}

.overall-banner.ok {
  border-color: rgba(34, 197, 94, 0.4);
}
.overall-banner.ok .ob-icon {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
}

.overall-banner.partial {
  border-color: rgba(251, 191, 36, 0.4);
}
.overall-banner.partial .ob-icon {
  background: rgba(251, 191, 36, 0.15);
  color: var(--yellow);
}

.overall-banner.major {
  border-color: rgba(239, 68, 68, 0.45);
}
.overall-banner.major .ob-icon {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
}

/* Stat cards */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 22px 0 40px;
}

.stat-card {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  animation: fadeInUp 0.6s var(--ease) both;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-bright);
  box-shadow: var(--shadow);
}

.stat-card .label {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
}

.stat-card .value {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  margin-top: 6px;
  font-variant-numeric: proportional-nums;
}

.stat-card.operational .value {
  color: var(--green);
}

.stat-card.issues .value {
  color: var(--red);
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: rgba(124, 58, 237, 0.15);
  color: var(--violet-light);
}

.stat-card.operational .stat-icon {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
}

.stat-card.issues .stat-icon {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
}

/* Maintenance banners */
.maintenance-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.maintenance-card {
  border-radius: var(--radius);
  padding: 18px 22px;
  border: 1px solid;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fadeInUp 0.5s var(--ease) both;
}

.maintenance-card .m-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.maintenance-card .m-body {
  flex: 1;
  min-width: 0;
}

.maintenance-card.scheduled {
  background: rgba(6, 182, 212, 0.07);
  border-color: rgba(6, 182, 212, 0.35);
}
.maintenance-card.scheduled .m-icon {
  background: rgba(6, 182, 212, 0.18);
  color: var(--cyan-light);
}

.maintenance-card.emergency {
  background: rgba(249, 115, 22, 0.08);
  border-color: rgba(249, 115, 22, 0.4);
}
.maintenance-card.emergency .m-icon {
  background: rgba(249, 115, 22, 0.18);
  color: var(--orange);
}

.maintenance-card .m-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14.5px;
  flex-wrap: wrap;
}

.maintenance-card .m-badge {
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.maintenance-card.scheduled .m-badge {
  background: rgba(6, 182, 212, 0.22);
  color: var(--cyan-light);
}

.maintenance-card.emergency .m-badge {
  background: rgba(249, 115, 22, 0.22);
  color: var(--orange);
}

.maintenance-card .m-message {
  color: var(--text-dim);
  font-size: 13.5px;
  margin-top: 6px;
}

.maintenance-card .m-meta {
  color: var(--text-faint);
  font-size: 12px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Groups */
.group {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  animation: fadeInUp 0.5s var(--ease) both;
}

.group:hover {
  border-color: var(--border-bright);
}

.group-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.group-header:hover {
  background: rgba(124, 58, 237, 0.07);
}

.group-chevron {
  color: var(--text-faint);
  transition: transform 0.3s var(--ease);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.group.collapsed .group-chevron {
  transform: rotate(-90deg);
}

.group-name {
  font-weight: 600;
  font-size: 15.5px;
  font-family: var(--font-heading);
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
}

.group-count {
  color: var(--text-faint);
  font-size: 12.5px;
  font-weight: 400;
  font-family: var(--font-body);
}

.group-spark {
  flex: 1 1 auto;
  display: flex;
  gap: 1px;
  align-items: center;
  width: 160px;
  max-width: 320px;
  height: 26px;
  overflow: hidden;
}

.spark-bar {
  flex: 1 1 0;
  height: 100%;
  border-radius: 2px;
  background: var(--gray);
  min-width: 0;
  transition: transform 0.15s ease;
}

.spark-bar:hover {
  transform: scaleY(1.15);
}

.group-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: nowrap;
}

.count-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  position: relative;
}

.status-dot.up {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.status-dot.down {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.status-dot.down::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid var(--red);
  animation: ring 1.6s ease-out infinite;
}

.status-dot.maintenance {
  background: var(--cyan-light);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.status-dot.unknown {
  background: var(--gray);
}

@keyframes ring {
  0% { transform: scale(0.7); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

.group-uptime {
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 13.5px;
}

.group-body-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 13px;
  padding: 4px 22px 22px;
}

.group-body {
  max-height: 4000px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.35s var(--ease), opacity 0.25s ease;
}

.group.collapsed .group-body {
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s var(--ease), opacity 0.15s ease;
}

.subgroup + .subgroup {
  border-top: 1px solid var(--border-soft);
}

.subgroup-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 22px 8px;
}

.flag {
  height: 15px;
  width: auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--border-soft);
  display: inline-block;
  vertical-align: -2px;
}

.subgroup-name {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.subgroup-count {
  font-size: 11.5px;
  color: var(--text-faint);
}

/* Service cards */
.service-card {
  position: relative;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  overflow: hidden;
}

.service-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gray);
  transition: width 0.2s ease;
}

.service-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-bright);
  box-shadow: var(--shadow);
}

.service-card:hover::before {
  width: 4px;
}

.service-card.up::before { background: var(--green); }
.service-card.down::before { background: var(--red); }
.service-card.maintenance::before { background: var(--cyan-light); }

.service-card .s-name {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 14px;
}

.service-card .s-region {
  color: var(--text-faint);
  font-size: 11.5px;
  margin: 3px 0 12px 18px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.service-card .s-region .icon {
  width: 11px;
  height: 11px;
}

.service-card .s-maint-tag {
  margin-left: 18px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--cyan-light);
  margin-bottom: 10px;
  font-weight: 600;
}

.service-card .s-metrics {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.service-card .s-metrics .m-label {
  color: var(--text-faint);
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.service-card .s-metrics .m-value {
  font-weight: 700;
  font-size: 14.5px;
  margin-top: 3px;
  font-family: var(--font-heading);
}

.service-card .s-lastcheck {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  font-size: 10.5px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 3, 9, 0.8);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 100;
  overflow-y: auto;
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  background: var(--bg-alt);
  background-image: radial-gradient(ellipse 100% 60% at 50% 0%, rgba(124, 58, 237, 0.18), transparent);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  max-width: 800px;
  width: 100%;
  padding: 28px 30px 32px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s var(--ease) both;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal-header h3 {
  font-size: 21px;
}

.modal-close {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-faint);
  border-radius: 9px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.modal-close:hover {
  color: var(--text);
  border-color: var(--border-bright);
}

.modal-close .icon {
  width: 15px;
  height: 15px;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cal-nav button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 9px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.cal-nav button:hover:not(:disabled) {
  border-color: var(--border-bright);
  background: rgba(124, 58, 237, 0.12);
}

.cal-nav button .icon {
  width: 15px;
  height: 15px;
}

.cal-nav button:disabled {
  opacity: 0.3;
  cursor: default;
}

.cal-nav .cal-month {
  font-weight: 600;
  font-size: 15px;
  font-family: var(--font-heading);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-dow {
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
  padding-bottom: 5px;
  font-weight: 600;
}

.cal-cell {
  aspect-ratio: 1 / 0.72;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  color: var(--text-dim);
  transition: transform 0.15s ease;
}

.cal-cell:not(.empty):hover {
  transform: scale(1.08);
  z-index: 1;
}

.cal-cell.empty {
  background: transparent;
  border: none;
}

.cal-cell .cal-day {
  font-weight: 600;
}

.cal-cell .cal-pct {
  font-size: 9.5px;
  opacity: 0.85;
}

.t-perfect {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: #eafff1;
}

.t-good {
  background: var(--green);
  border-color: var(--green);
  color: #06280f;
}

.t-warn {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #2a1c00;
}

.t-bad {
  background: var(--orange);
  border-color: var(--orange);
  color: #2a1400;
}

.t-critical {
  background: var(--red);
  border-color: var(--red);
  color: #2a0505;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 18px 0 24px;
  font-size: 11.5px;
  color: var(--text-dim);
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 13px;
  height: 13px;
  border-radius: 4px;
  border: 1px solid var(--border-soft);
}

.incidents h4 {
  font-size: 13px;
  margin-bottom: 12px;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 7px;
}

.incident-card {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  margin-bottom: 10px;
}

.incident-card .i-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 6px;
}

.incident-card .i-title {
  color: var(--red);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.incident-card .i-when {
  color: var(--text-faint);
  font-size: 11.5px;
}

.incident-card .i-detail {
  margin-top: 7px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.empty-note {
  color: var(--text-faint);
  font-size: 13px;
  padding: 6px 0 2px;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 44px 0 64px;
  color: var(--text-faint);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .wrap {
    padding: 0 16px;
  }

  /* Header: drop the secondary nav links so brand + live indicator always
     fit on one line instead of overflowing off-screen. */
  .site-header .wrap {
    height: 60px;
  }
  .header-links {
    gap: 10px;
  }
  .header-links a {
    display: none;
  }
  .live-pill {
    padding: 6px 11px;
    font-size: 11.5px;
    gap: 6px;
  }
  .brand {
    font-size: 16px;
    gap: 8px;
  }
  .brand-mark {
    height: 26px;
  }

  .hero {
    padding: 40px 0 24px;
  }
  .hero .eyebrow {
    font-size: 10.5px;
    padding: 5px 12px;
    margin-bottom: 18px;
  }
  .hero h1 {
    font-size: 32px;
  }
  .hero p {
    font-size: 15px;
    max-width: 100%;
  }

  .overall-banner {
    flex-direction: column;
    text-align: center;
    padding: 20px 18px;
    gap: 14px;
    margin-top: 26px;
  }
  .overall-banner .ob-text {
    text-align: center;
  }
  .overall-banner .ob-icon {
    width: 44px;
    height: 44px;
  }

  .stats {
    grid-template-columns: 1fr;
    margin: 18px 0 28px;
  }
  .stat-card {
    padding: 18px 20px;
  }

  .maintenance-card {
    padding: 15px 16px;
  }

  /* Group header: let the count/uptime cluster drop to its own line
     instead of forcing a single nowrap row wider than the screen. */
  .group-header {
    flex-wrap: wrap;
    padding: 15px 16px;
    gap: 8px 10px;
  }
  .group-spark {
    display: none;
  }
  .group-right {
    flex: 1 1 auto;
    justify-content: flex-end;
    flex-wrap: wrap;
    white-space: normal;
    margin-left: auto;
    padding-left: 26px;
  }

  .group-body-inner {
    grid-template-columns: 1fr;
    padding: 4px 16px 16px;
  }
  .subgroup-header {
    padding: 12px 16px 6px;
  }

  .modal-backdrop {
    padding: 20px 8px;
  }
  .modal {
    padding: 20px 18px 24px;
  }
  .cal-grid {
    gap: 4px;
  }
  .cal-cell {
    font-size: 9.5px;
    border-radius: 6px;
  }
  .cal-cell .cal-pct {
    font-size: 8px;
  }
  .legend {
    gap: 10px;
    font-size: 10.5px;
  }

  .blob-1, .blob-2, .blob-3 {
    filter: blur(60px);
  }
}

@media (max-width: 400px) {
  .hero h1 {
    font-size: 27px;
  }
  .hero .eyebrow {
    font-size: 9.5px;
    padding: 5px 10px;
  }
  .stat-card .value {
    font-size: 29px;
  }
  .stat-icon {
    width: 40px;
    height: 40px;
  }
  .cal-nav button {
    width: 30px;
    height: 30px;
  }
  .cal-nav .cal-month {
    font-size: 13.5px;
  }
}
