:root {
  --bg: #f6f2f7;
  --card: rgba(255, 255, 255, 0.9);
  --card2: rgba(255, 255, 255, 0.98);
  --border: rgba(23, 18, 31, 0.12);
  --text: rgba(23, 18, 31, 0.92);
  --muted: rgba(23, 18, 31, 0.6);
  --shadow: 0 12px 36px rgba(23, 18, 31, 0.12);
  --accent: #2aa7ff;

  --ok: #2ee59d;
  --minor: #ffd166;
  --partial: #f8961e;
  --major: #ef476f;
  --maint: #6ea8fe;
  --blocked: rgba(139, 148, 166, 0.85);
  --unknown: rgba(255, 255, 255, 0.25);

  --radius: 16px;
  --radiusSm: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  --sans: "Proxima Nova", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1100px 700px at 20% 0%, rgba(68, 22, 69, 0.08), transparent 60%),
    radial-gradient(1000px 700px at 100% 0%, rgba(42, 167, 255, 0.06), transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(42, 167, 255, 0.5);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: rgba(255, 255, 255, 0.75);
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: rgba(246, 242, 247, 0.9);
  border-bottom: 1px solid var(--border);
}

.topbar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  gap: 16px;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar__cta {
  appearance: none;
  border: 1px solid rgba(42, 167, 255, 0.4);
  background: rgba(42, 167, 255, 0.14);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.topbar__cta:hover {
  filter: brightness(1.03);
}

.topbar__cta:focus-visible {
  outline: 2px solid rgba(42, 167, 255, 0.6);
  outline-offset: 2px;
}

.topbar__link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.topbar__link:hover {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: rgba(23, 18, 31, 0.45);
  text-underline-offset: 3px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
  color: inherit;
}

.brand__mark {
  width: 120px;
  height: 38px;
  border-radius: 0;
  background: url("./assets/trolley-logo.svg") center / contain no-repeat;
}

.brand__title {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand__subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.statuspill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  font-weight: 600;
  white-space: nowrap;
}

.statusdot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--unknown);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
}

.card {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin: 18px 0;
}

.card--alert {
  border: 1px solid rgba(239, 71, 111, 0.3);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
}

.card--alert.is-hidden {
  display: none;
}

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

.pager {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.pager__btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.pager__btn:disabled {
  cursor: default;
  opacity: 0.5;
}

.pager__meta {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}

.card__title {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.subscribe {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.subscribe--modal {
  justify-content: space-between;
  gap: 14px;
}

.subscribe-modal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card2), var(--card));
  box-shadow: var(--shadow);
  width: min(720px, calc(100% - 32px));
  padding: 18px;
}

.subscribe-modal::backdrop {
  background: rgba(23, 18, 31, 0.35);
  backdrop-filter: blur(2px);
}

.subscribe-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.subscribe-modal__title {
  margin: 0;
  font-size: 18px;
}

.subscribe-modal__close {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.subscribe-modal__close:hover {
  filter: brightness(1.03);
}

.subscribe-modal__close:focus-visible {
  outline: 2px solid rgba(42, 167, 255, 0.6);
  outline-offset: 2px;
}

.subscribe__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none;
}

.subscribe__link--slack {
  background: #4a154b;
  color: #fff;
}

.subscribe__link--slack:hover {
  text-decoration: none;
  filter: brightness(1.05);
}

.slack-btn__logo {
  width: 20px;
  height: 20px;
  display: block;
}

.subscribe__divider {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.subscribe__form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.subscribe__input {
  appearance: none;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;
  min-width: 220px;
}

.subscribe__input:focus {
  outline: 2px solid rgba(42, 167, 255, 0.35);
  outline-offset: 1px;
  border-color: rgba(42, 167, 255, 0.45);
}

.subscribe__btn {
  appearance: none;
  border: 1px solid rgba(42, 167, 255, 0.4);
  background: rgba(42, 167, 255, 0.14);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

.subscribe__btn:hover {
  filter: brightness(1.03);
}

.subscribe__message {
  flex-basis: 100%;
  order: 10;
  min-height: 20px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.subscribe__message.is-success {
  color: #0f7a4b;
}

.subscribe__message.is-error {
  color: rgba(239, 71, 111, 0.95);
}

.subscribe__form.is-loading .subscribe__btn {
  cursor: progress;
  opacity: 0.75;
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control {
  display: grid;
  gap: 6px;
}

.control__label {
  font-size: 12px;
  color: var(--muted);
}

.control__input {
  appearance: none;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 34px 10px 12px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, rgba(23, 18, 31, 0.45) 50%),
    linear-gradient(135deg, rgba(23, 18, 31, 0.45) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.control__input:focus {
  outline: 2px solid rgba(42, 167, 255, 0.6);
  outline-offset: 2px;
}

.list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 900px) {
  .list {
    grid-template-columns: 1fr 1fr;
  }
}

.listcol {
  display: grid;
  gap: 12px;
  align-content: start;
}

.listsection {
  display: grid;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid rgba(23, 18, 31, 0.08);
}

.listsection:first-child {
  border-top: 0;
  padding-top: 0;
}

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

.listsection__title {
  font-weight: 650;
}

.listsection__items {
  display: grid;
  gap: 8px;
}

.listgroup {
  border-radius: var(--radiusSm);
  border: 1px solid rgba(23, 18, 31, 0.08);
  background: rgba(23, 18, 31, 0.04);
  padding: 6px 10px;
}

.listgroup__summary {
  cursor: pointer;
  list-style: none;
  font-weight: 650;
  padding: 8px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.listgroup__main {
  display: grid;
  gap: 4px;
}

.listgroup__uptime {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.listgroup__summary::-webkit-details-marker {
  display: none;
}

.listgroup__summary::after {
  content: "▾";
  float: right;
  color: var(--muted);
}

.listgroup[open] .listgroup__summary::after {
  content: "▴";
}

.listgroup__items {
  display: grid;
  gap: 8px;
  padding: 6px 2px 10px;
}

.listitem {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 12px;
  border-radius: var(--radiusSm);
  border: 1px solid rgba(23, 18, 31, 0.08);
  background: rgba(23, 18, 31, 0.04);
  align-items: center;
}

.listitem__main {
  display: grid;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.listitem__name {
  font-weight: 650;
  min-width: 0;
}

.listitem__uptime {
  font-size: 12px;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(23, 18, 31, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: rgba(23, 18, 31, 0.86);
  flex-shrink: 0;
}

.pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--unknown);
}

.stack {
  display: grid;
  gap: 12px;
}

.event-section {
  display: grid;
  gap: 10px;
}

.event-section + .event-section {
  margin-top: 16px;
}

.event-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.event-section__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.incident {
  padding: 12px;
  border-radius: var(--radiusSm);
  border: 1px solid rgba(23, 18, 31, 0.08);
  background: rgba(23, 18, 31, 0.04);
}

.incident--link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease;
  cursor: pointer;
}

.incident--link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(23, 18, 31, 0.08);
}

.incident--link:focus-visible {
  outline: 2px solid rgba(42, 167, 255, 0.6);
  outline-offset: 2px;
}

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

.incident__titleGroup {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.incident__title {
  font-weight: 700;
}

.incident__meta {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.incident__type {
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(23, 18, 31, 0.18);
  background: rgba(23, 18, 31, 0.06);
  color: rgba(23, 18, 31, 0.78);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.incident__type--maintenance {
  border-color: rgba(110, 168, 254, 0.5);
  background: rgba(110, 168, 254, 0.2);
}

.incident__type--holiday {
  border-color: rgba(145, 120, 255, 0.5);
  background: rgba(145, 120, 255, 0.2);
}

.incident__type--incident {
  border-color: rgba(239, 71, 111, 0.5);
  background: rgba(239, 71, 111, 0.16);
}

.incident__body {
  margin-top: 8px;
  color: rgba(23, 18, 31, 0.82);
  line-height: 1.35;
}

.incident__body p {
  margin: 0;
}

.incident__components {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.incident-detail__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.incident-detail__title {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.2px;
}

.incident-detail__meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}

.incident-detail__summary {
  margin-top: 12px;
  color: rgba(23, 18, 31, 0.86);
  line-height: 1.4;
}

.incident-detail__summary p {
  margin: 0;
}

.incident-detail__impacted {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.incident-detail__impacted-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.incident-detail__impacted-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  border-top: 1px solid rgba(23, 18, 31, 0.08);
}

.incident-detail__impacted-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 2px;
  font-size: 14px;
  color: rgba(23, 18, 31, 0.9);
  align-items: center;
  border-bottom: 1px solid rgba(23, 18, 31, 0.08);
}

.incident-detail__impacted-name {
  font-weight: 600;
  line-height: 1.3;
}

.incident-detail__impacted-pill {
  flex-shrink: 0;
  box-shadow: none;
  border-color: rgba(23, 18, 31, 0.14);
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--mono);
  border: 1px solid rgba(23, 18, 31, 0.15);
  background: rgba(255, 255, 255, 0.9);
  color: rgba(23, 18, 31, 0.9);
}

.status-tag:empty {
  display: none;
}

.status-tag--investigating {
  border-color: rgba(248, 150, 30, 0.45);
  background: rgba(248, 150, 30, 0.12);
}

.status-tag--identified {
  border-color: rgba(239, 71, 111, 0.45);
  background: rgba(239, 71, 111, 0.12);
}

.status-tag--monitoring {
  border-color: rgba(255, 209, 102, 0.45);
  background: rgba(255, 209, 102, 0.18);
}

.status-tag--resolved {
  border-color: rgba(46, 229, 157, 0.45);
  background: rgba(46, 229, 157, 0.14);
}

.status-tag--unknown {
  border-color: rgba(139, 148, 166, 0.45);
  background: rgba(139, 148, 166, 0.14);
}

.timeline {
  display: grid;
  gap: 18px;
  position: relative;
  padding-left: 36px;
  padding-bottom: 6px;
  z-index: 0;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 12px;
  width: 2px;
  background: rgba(23, 18, 31, 0.12);
  border-radius: 999px;
  z-index: 0;
}

.timeline--ended::before {
  bottom: 40px;
}

.timeline__item {
  position: relative;
  padding-left: 4px;
  z-index: 1;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid rgba(139, 148, 166, 0.6);
  box-shadow: 0 0 0 4px rgba(139, 148, 166, 0.12);
  z-index: 2;
}

.timeline__item::after {
  content: "";
  position: absolute;
  left: -31px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #fff;
  z-index: 1;
}

.timeline__item--pending::before {
  background: #fff;
  border: 2px solid rgba(139, 148, 166, 0.6);
  box-shadow: 0 0 0 4px rgba(139, 148, 166, 0.12);
}

.timeline__item--pending::after {
  display: none;
}

.timeline__item--complete::before {
  background: rgba(139, 148, 166, 0.6);
  border-color: rgba(139, 148, 166, 0.6);
}

.timeline__title {
  font-weight: 700;
  font-size: 16px;
  margin: 0;
}

.timeline__value {
  margin-top: 4px;
  color: rgba(23, 18, 31, 0.7);
}

.timeline__time {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}

.timeline__value p {
  margin: 0;
}

.coverage {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 18px;
  align-items: start;
}

.coverage__mapWrap {
  position: relative;
  border-radius: var(--radiusSm);
  border: 1px solid rgba(23, 18, 31, 0.08);
  background: rgba(23, 18, 31, 0.04);
  overflow: hidden;
}

.coverage__map {
  display: block;
  width: 100%;
  height: auto;
}

.region {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1.5;
  cursor: default;
  transition: transform 120ms ease, filter 120ms ease;
  transform-origin: center;
}

.region[data-region-status="blocked"] {
  stroke: rgba(23, 18, 31, 0.45);
  stroke-width: 1.8;
  filter: saturate(1.05);
  fill-opacity: 1;
}

.region:focus {
  outline: none;
  filter: drop-shadow(0 0 6px rgba(110, 168, 254, 0.55));
}

.region:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.tooltip {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(23, 18, 31, 0.12);
  background: rgba(255, 255, 255, 0.95);
  color: rgba(23, 18, 31, 0.9);
  font-size: 12px;
  font-family: var(--mono);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease;
  pointer-events: none;
  max-width: calc(100% - 20px);
}

.tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.coverage__legend {
  border-radius: var(--radiusSm);
  border: 1px solid rgba(23, 18, 31, 0.08);
  background: rgba(23, 18, 31, 0.04);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.legend__row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(23, 18, 31, 0.84);
  font-size: 13px;
}

.legend__swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(23, 18, 31, 0.15);
}

.swatch--operational {
  background: rgba(46, 229, 157, 0.85);
}
.swatch--degraded {
  background: rgba(255, 209, 102, 0.85);
}
.swatch--partial {
  background: rgba(248, 150, 30, 0.85);
}
.swatch--major {
  background: rgba(239, 71, 111, 0.85);
}
.swatch--maintenance {
  background: rgba(110, 168, 254, 0.85);
}
.swatch--holiday {
  background: rgba(145, 120, 255, 0.85);
}
.swatch--blocked {
  background: var(--blocked);
}
.swatch--unknown {
  background: rgba(255, 255, 255, 0.18);
}

@media (max-width: 900px) {
  .card__header {
    flex-direction: column;
    align-items: flex-start;
  }
  .statuspill {
    width: 100%;
    justify-content: center;
  }
  .coverage {
    grid-template-columns: 1fr;
  }
}
