:root {
  --bg: #050b0e;
  --bg-2: #08121600;
  --card: #0a1317;
  --card-2: #0d181d;
  --line: rgba(238, 243, 244, 0.08);
  --line-2: rgba(238, 243, 244, 0.14);
  --text: #eef3f4;
  --muted: #91a2a7;
  --brand-a: #25757e;
  --brand-b: #3c7b9a;
  --grad: linear-gradient(135deg, #25757e, #3c7b9a);
  --ok: #3ecf8e;
  --warn: #f5b83d;
  --bad: #f0524f;
  --maint: #4c9bf0;
  --none: #2a3a40;
  --radius: 14px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(900px 380px at 50% -140px, rgba(60, 123, 154, 0.2), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration-color: rgba(238, 243, 244, 0.3);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-color: currentColor;
}
a:focus-visible,
.strip:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand-b);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}

.wrap {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}
main.wrap {
  flex: 1;
  padding-bottom: 48px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--card-2);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 10;
}
.skip:focus {
  left: 16px;
}

/* header */
.top {
  padding: 18px 0;
}
.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand,
.top-nav {
  white-space: nowrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.logo {
  display: block;
  width: 36px;
  height: 31px;
  border-radius: 8px;
  object-fit: cover;
}
.brand-tag {
  font-weight: 400;
  color: var(--muted);
}
.top-nav {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: var(--muted);
}
.top-nav a {
  text-decoration: none;
}
.top-nav a:hover {
  color: var(--text);
}

/* hero */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 12px 0 28px;
  padding: 22px 24px;
  background: linear-gradient(120deg, rgba(37, 117, 126, 0.16), rgba(60, 123, 154, 0.05) 60%), var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.hero h1 {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hero p {
  margin-top: 4px;
}
.hero-note {
  color: var(--warn);
  font-size: 14px;
}
.hero-icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ok);
  background: color-mix(in srgb, currentColor 14%, transparent);
}
.hero-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tone-degraded .hero-icon {
  color: var(--warn);
}
.tone-down .hero-icon {
  color: var(--bad);
}
.tone-maintenance .hero-icon {
  color: var(--maint);
}
.tone-nodata .hero-icon {
  color: var(--muted);
}

/* sections */
.section {
  margin-top: 28px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 0 2px;
}
.section-head h2 {
  font-size: 16px;
  font-weight: 600;
}
.aside {
  color: var(--muted);
  font-size: 13px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card.pad {
  padding: 18px 20px;
}
.stack {
  display: grid;
  gap: 10px;
}

/* notices (maintenance) */
.notice {
  background: linear-gradient(120deg, rgba(76, 155, 240, 0.12), rgba(76, 155, 240, 0.03)), var(--card);
  border: 1px solid rgba(76, 155, 240, 0.28);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.notice h3 {
  font-size: 16px;
  margin: 8px 0 2px;
}
.notice .inc-msg {
  margin-top: 2px;
}

/* chips + pills */
.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 13px;
}
.chip {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--line-2);
  color: var(--muted);
  white-space: nowrap;
}
.chip.st-maint {
  color: var(--maint);
  border-color: rgba(76, 155, 240, 0.4);
  background: rgba(76, 155, 240, 0.1);
}
.chip.sev-minor {
  color: var(--warn);
  border-color: rgba(245, 184, 61, 0.4);
}
.chip.sev-major,
.chip.sev-critical {
  color: var(--bad);
  border-color: rgba(240, 82, 79, 0.45);
}
.chip.st-resolved {
  color: var(--ok);
  border-color: rgba(62, 207, 142, 0.4);
}
.chip.st-investigating,
.chip.st-identified,
.chip.st-monitoring {
  color: var(--text);
}

.pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 11px 3px 9px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ok);
  background: color-mix(in srgb, currentColor 12%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  white-space: nowrap;
}
.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.pill.s-degraded {
  color: var(--warn);
}
.pill.s-down {
  color: var(--bad);
}
.pill.s-maintenance {
  color: var(--maint);
}
.pill.s-nodata {
  color: var(--muted);
}

/* services */
.svc {
  padding: 18px 20px 16px;
}
.svc + .svc {
  border-top: 1px solid var(--line);
}
.svc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.svc-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.svc-name a {
  text-decoration: none;
}
.svc-name a:hover {
  text-decoration: underline;
}
.svc-name .ext span {
  color: var(--muted);
  font-weight: 400;
}
.svc-desc {
  color: var(--muted);
  font-size: 14px;
  margin-top: 1px;
}

.strip {
  display: flex;
  gap: 2px;
  height: 34px;
  margin-top: 14px;
}
.b {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 2px;
  background: var(--none);
  transition: transform 0.08s;
}
.b.ok {
  background: var(--ok);
}
.b.warn {
  background: var(--warn);
}
.b.bad {
  background: var(--bad);
}
.b.maint {
  background: var(--maint);
}
.b.none {
  background: var(--none);
}
.b:hover,
.b.on {
  transform: scaleY(1.12);
  filter: brightness(1.25);
}

.axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}
.ax-30 {
  display: none;
}

.svc-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-top: 10px;
  font-size: 13px;
}
.metrics {
  color: var(--muted);
}
.uptime {
  flex: none;
  color: var(--muted);
  text-align: right;
}
.uptime strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* tooltip (status.js) */
.tip {
  position: fixed;
  z-index: 20;
  max-width: 280px;
  padding: 8px 11px;
  background: #121f25;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 12.5px;
  line-height: 1.4;
  pointer-events: none;
}
.tip[hidden] {
  display: none;
}

/* past incidents */
.past .day {
  padding: 16px 20px;
}
.past .day + .day,
.past .inc + .inc {
  border-top: 1px solid var(--line);
}
.day h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.inc {
  padding: 4px 0 6px;
}
.inc h4 {
  font-size: 15px;
  font-weight: 600;
}
.inc .chips {
  margin: 3px 0;
}
.inc-msg {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.stack .inc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 20px;
}
.past .day .inc {
  padding-left: 0;
  padding-right: 0;
}
.past > .inc {
  padding: 14px 20px;
}
.more {
  margin-top: 12px;
  padding: 0 2px;
  font-size: 14px;
}

/* subpages */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 12px 0 18px;
}
.page-head.col {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.page-head h1 {
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.summary {
  font-size: 16px;
}
.crumb {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}
.pager {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.pager a,
.pager .off {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  text-decoration: none;
}
.pager .off {
  opacity: 0.3;
}
.pager a:hover {
  background: var(--card-2);
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 6px 20px;
}
.timeline li {
  position: relative;
  padding: 14px 0 14px 22px;
}
.timeline li + li {
  border-top: 1px solid var(--line);
}
.timeline li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 22px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--grad);
}
.tl-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 2px;
}
.card.pad + .timeline,
.card.pad + .card {
  margin-top: 14px;
}
.page-head + .card.pad,
.page-head + .timeline {
  margin-top: 0;
}

/* admin forms */
.form {
  display: grid;
  gap: 14px;
}
.field {
  display: grid;
  gap: 5px;
}
.field label,
legend {
  font-size: 13px;
  color: var(--muted);
}
input,
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: #060e11;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  padding: 9px 11px;
}
textarea {
  resize: vertical;
}
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.checks {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 12px 10px;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}
.check input {
  width: auto;
}
.btn {
  justify-self: start;
  font: inherit;
  font-weight: 500;
  color: #fff;
  background: var(--grad);
  border: 0;
  border-radius: 9px;
  padding: 9px 18px;
  cursor: pointer;
}
.btn:hover {
  filter: brightness(1.12);
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line-2);
}
.btn.danger {
  background: rgba(240, 82, 79, 0.16);
  border: 1px solid rgba(240, 82, 79, 0.5);
  color: #ffb3b1;
}
.inline-form {
  margin-top: 12px;
}
.flash {
  padding: 10px 14px;
  border-radius: 9px;
  margin-bottom: 8px;
}
.flash.ok {
  background: rgba(62, 207, 142, 0.12);
  border: 1px solid rgba(62, 207, 142, 0.35);
}
.flash.err {
  background: rgba(240, 82, 79, 0.12);
  border: 1px solid rgba(240, 82, 79, 0.4);
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.foot {
  padding-top: 20px;
  padding-bottom: 32px;
  color: var(--muted);
  font-size: 13px;
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--line);
}

@media (max-width: 560px) {
  body {
    font-size: 14.5px;
  }
  .hero {
    padding: 18px 16px 18px 22px;
    gap: 12px;
  }
  .hero h1 {
    font-size: 20px;
  }
  .hero-icon {
    width: 34px;
    height: 34px;
  }
  .svc {
    padding: 16px 14px 14px;
  }
  .svc-id {
    min-width: 0;
  }
  .past .day {
    padding: 14px;
  }
  /* 30 days instead of 90 so every bar stays tappable on a 360px phone */
  .b:nth-last-child(n + 31) {
    display: none;
  }
  .strip {
    gap: 3px;
  }
  .ax-90 {
    display: none;
  }
  .ax-30 {
    display: inline;
  }
  .row2 {
    grid-template-columns: 1fr;
  }
  .page-head h1 {
    font-size: 22px;
  }
  .top-nav {
    gap: 14px;
    font-size: 13.5px;
  }
  .brand {
    font-size: 16px;
    gap: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
