@charset "UTF-8";
/*
 * status-app PUBLIC PAGE styles (B-115).
 *
 * Self contained on purpose. No font import, no CDN, no external image, no
 * third party request of any kind: a status page that depends on somebody
 * else's infrastructure is a status page that goes down when they do.
 *
 * Colour notes, because these values are not arbitrary:
 *   - The four status colours are fixed and identical in light and dark. They
 *     are reserved for state and never used for anything decorative. Every
 *     place one appears, an icon and a word appear with it, so the meaning
 *     never rests on colour alone.
 *   - The response time chart uses one series colour, stepped separately for
 *     each mode against that mode's surface.
 *   - --brand comes from the accounts table and is confined to the logo mark,
 *     links and focus rings. It is deliberately kept away from anything that
 *     encodes state, so a tenant whose brand colour happens to be red cannot
 *     make a healthy service look broken.
 */

:root {
  color-scheme: light dark;

  --surface-page: #f6f6f4;
  --surface-card: #ffffff;
  --surface-sunk: #efeeeb;
  --border: #e3e2de;
  --border-strong: #d3d2cd;

  --text-primary: #171614;
  --text-secondary: #56544f;
  /* WCAG AA. The old #78766f gave 4.20:1 on the page background and 3.92:1 on
     the sunk stat tiles, and every use of it is normal weight text under
     18.66px, so AA needs 4.5:1. This value clears it on all three light
     surfaces: 5.39 on #f6f6f4, 5.02 on #efeeeb, 5.83 on #ffffff. Dark mode
     already passed and is unchanged. */
  --text-muted: #67655f;

  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --info: #2a78d6;

  --series-1: #2a78d6;
  --series-1-fill: rgba(42, 120, 214, 0.14);

  --nodata: #d8d7d2;

  --brand: #2563eb;

  --radius: 12px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 15, 13, 0.05), 0 1px 3px rgba(16, 15, 13, 0.04);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  --font-num: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface-page: #131312;
    --surface-card: #1c1c1a;
    --surface-sunk: #232321;
    --border: #2f2f2c;
    --border-strong: #3d3d39;

    --text-primary: #f7f7f4;
    --text-secondary: #c3c2b9;
    --text-muted: #8f8e85;

    --series-1: #3987e5;
    /* Lighter than the light mode fill on purpose. The same alpha over a dark
     * surface reads as a solid block rather than as a wash under the line. */
    --series-1-fill: rgba(57, 135, 229, 0.13);

    /* Has to sit clearly above the card surface, otherwise a run of "no data"
     * days looks like a rendering gap instead of information. */
    --nodata: #3f3f3b;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

/* --------------------------------------------------------------------------
 * Base
 * ----------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  padding: 0;
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 3px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.011em;
}

.wrap {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --------------------------------------------------------------------------
 * Header and footer
 * ----------------------------------------------------------------------- */

.head {
  padding: 34px 0 22px;
}

.head__brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.head__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  flex: none;
}

.head__name {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.head__sub {
  margin: 4px 0 0 45px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Brand logo.
 *
 * Sized by height with width:auto so any account's artwork keeps its own
 * aspect ratio, and capped in vw so a wide wordmark cannot push the header
 * sideways on a narrow phone. Both current logos carry their own colours and
 * read on light and dark alike, so there is no theme swap here. */
.head__logo {
  display: block;
  height: 28px;
  width: auto;
  max-width: min(280px, 64vw);
}

.head__brand--logo {
  gap: 0;
}

/* The initial-letter mark is 34px wide plus an 11px gap, and the subtitle is
 * indented to sit under the name beside it. A logo replaces the mark, so that
 * indent has to go or the subtitle hangs off to the right of nothing. */
.head__sub--logo {
  margin-left: 0;
}

.foot__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.foot__logo {
  display: block;
  height: 15px;
  width: auto;
  max-width: 150px;
}

.foot {
  /* auto, not 0, on the horizontal axis. .foot carries .wrap too, and .wrap
     centres with `margin: 0 auto`, so a shorthand with 0 here silently undoes
     it and drops the footer against the left edge while the rest of the page
     stays centred. */
  margin: 44px auto 40px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12.5px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: space-between;
}

/* --------------------------------------------------------------------------
 * Overall banner
 * ----------------------------------------------------------------------- */

.banner {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 19px 21px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--state, var(--text-muted));
  border-radius: var(--radius);
  background: var(--surface-card);
  box-shadow: var(--shadow);
}

.banner--operational { --state: var(--good); }
.banner--degraded    { --state: var(--warning); }
.banner--major_outage { --state: var(--critical); }
.banner--maintenance { --state: var(--info); }
.banner--unknown     { --state: var(--text-muted); }

.banner__mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  color: var(--state);
  background: color-mix(in srgb, var(--state) 13%, transparent);
}

.banner__ico {
  width: 22px;
  height: 22px;
}

.banner__text {
  min-width: 0;
  flex: 1;
}

.banner__title {
  font-size: 19px;
  line-height: 1.3;
}

.banner__meta {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.banner__counts {
  display: flex;
  gap: 10px;
  margin: 0;
  flex: none;
}

.chip {
  text-align: right;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

.chip__label {
  color: var(--text-muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chip__value {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
 * Blocks
 * ----------------------------------------------------------------------- */

.block {
  margin-top: 30px;
}

.block__bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.block__title {
  font-size: 13px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.block__bar .block__title {
  margin-bottom: 0;
}

.empty {
  margin: 0;
  padding: 26px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-align: center;
  font-size: 14px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  color: var(--text-muted);
  font-size: 12px;
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  display: inline-block;
}

.swatch--up { background: var(--good); }
.swatch--degraded { background: var(--warning); }
.swatch--down { background: var(--critical); }
.swatch--nodata { background: var(--nodata); }

/* --------------------------------------------------------------------------
 * Monitor cards
 * ----------------------------------------------------------------------- */

.cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  padding: 17px 19px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-card);
  box-shadow: var(--shadow);
}

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

.card__name {
  font-size: 15.5px;
  font-weight: 620;
  min-width: 0;
  overflow-wrap: anywhere;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--state, var(--text-muted));
  background: color-mix(in srgb, var(--state, var(--text-muted)) 12%, transparent);
}

.pill--up { --state: var(--good); }
.pill--down { --state: var(--critical); }
.pill--maintenance { --state: var(--info); }
.pill--unknown { --state: var(--text-muted); }

.pill__ico {
  width: 13px;
  height: 13px;
}

/* 90 day uptime bar ------------------------------------------------------ */

.uptime {
  margin-bottom: 12px;
}

.uptime__bars {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 34px;
}

.day {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 2px;
  background: var(--nodata);
  position: relative;
  transition: transform 0.08s ease;
}

.day--up { background: var(--good); }
.day--degraded { background: var(--warning); }
.day--down { background: var(--critical); }
.day--nodata { background: var(--nodata); }

.day:hover {
  transform: scaleY(1.12);
  z-index: 3;
}

.uptime__scale {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 11.5px;
}

.uptime__mid {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Uptime figures --------------------------------------------------------- */

.stats {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
}

.stat {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-sunk);
}

.stat__label {
  color: var(--text-muted);
  font-size: 11.5px;
}

.stat__value {
  margin: 1px 0 0;
  font-size: 15px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

/* Response time chart ---------------------------------------------------- */

.chart {
  margin: 0;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}

.chart__cap {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: 11.5px;
  margin-bottom: 7px;
}

.chart__scale {
  font-variant-numeric: tabular-nums;
}

.chart__plot {
  position: relative;
  height: 64px;
}

.chart__svg {
  display: block;
  width: 100%;
  height: 64px;
  overflow: visible;
}

/* non-scaling-stroke is what keeps the 2px line honest when the SVG is
 * stretched to the card width with preserveAspectRatio none. */
.chart__line {
  fill: none;
  stroke: var(--series-1);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chart__dot {
  fill: var(--series-1);
  stroke: var(--surface-card);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart__area {
  fill: var(--series-1-fill);
  stroke: none;
}

.chart__fail {
  fill: var(--critical);
  opacity: 0.85;
}

.chart__hits {
  position: absolute;
  inset: 0;
  display: flex;
}

.hit {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
}

.hit:hover {
  background: color-mix(in srgb, var(--text-primary) 7%, transparent);
}

.chart__meta {
  display: flex;
  gap: 18px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.metric {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12.5px;
}

.metric__label {
  color: var(--text-muted);
}

.metric__value {
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

.chart--empty .chart__empty {
  margin: 6px 0 2px;
  color: var(--text-muted);
  font-size: 12.5px;
}

/* --------------------------------------------------------------------------
 * Tooltips
 *
 * Pure CSS, driven by data-tip. No JavaScript, so a reader with scripting
 * disabled gets exactly the same hover detail as everybody else.
 * ----------------------------------------------------------------------- */

[data-tip],
.day {
  cursor: default;
}

/* The day bars label themselves with aria-label and the tooltip is drawn from
 * that same attribute, so the text is written into the markup once instead of
 * twice for every one of the 90 bars on every card. */
[data-tip]::after {
  content: attr(data-tip);
}

.day::after {
  content: attr(aria-label);
}

[data-tip]::after,
.day::after {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--text-primary);
  color: var(--surface-card);
  font-size: 11.5px;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  /* display none rather than opacity or visibility, and this is not a style
   * preference. A hidden but still laid out absolutely positioned tooltip
   * keeps contributing to the document's scrollable overflow, and 700 of them
   * hanging off the right hand bars gave the page a horizontal scrollbar on a
   * phone. Measured at 390px wide: scrollWidth 439 before this change, 390
   * after. The cost is losing a 100ms fade, which nobody wanted. */
  display: none;
}

[data-tip]::before,
.day::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  border: 5px solid transparent;
  border-top-color: var(--text-primary);
  pointer-events: none;
  display: none;
}

[data-tip]:hover::after,
[data-tip]:hover::before,
.day:hover::after,
.day:hover::before {
  display: block;
}

/* The first and last few bars would push their tooltip off the edge of the
 * viewport, so those anchor to their own side instead of centring. */
.uptime__bars .day:nth-child(-n + 12)::after,
.chart__hits .hit:nth-child(-n + 12)::after {
  left: 0;
  transform: none;
}

.uptime__bars .day:nth-last-child(-n + 12)::after,
.chart__hits .hit:nth-last-child(-n + 12)::after {
  left: auto;
  right: 0;
  transform: none;
}

/* --------------------------------------------------------------------------
 * Incidents
 * ----------------------------------------------------------------------- */

.inc {
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-card);
  box-shadow: var(--shadow);
}

.inc + .inc {
  margin-top: 10px;
}

.inc--open {
  border-left: 4px solid var(--critical);
}

.inc--open.inc--minor {
  border-left-color: var(--warning);
}

.inc--open.inc--maintenance {
  border-left-color: var(--info);
}

.inc__head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.02em;
  background: var(--surface-sunk);
  color: var(--text-secondary);
}

/* The open tag takes the severity's colour, not always red. A maintenance
 * window wearing outage red tells the reader the opposite of the truth. */
.tag--open {
  background: color-mix(in srgb, var(--critical) 13%, transparent);
  color: var(--critical);
}

.inc--minor .tag--open {
  background: color-mix(in srgb, var(--warning) 18%, transparent);
  color: color-mix(in srgb, var(--warning) 72%, var(--text-primary));
}

.inc--maintenance .tag--open {
  background: color-mix(in srgb, var(--info) 13%, transparent);
  color: var(--info);
}

.tag--resolved {
  background: color-mix(in srgb, var(--good) 13%, transparent);
  color: var(--good);
}

.inc__title {
  font-size: 15.5px;
  line-height: 1.4;
}

.inc__title a {
  color: inherit;
}

.inc__when {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 12.5px;
}

.inc__body {
  margin-top: 9px;
  color: var(--text-secondary);
  font-size: 14px;
}

.inc__body p {
  margin: 0 0 8px;
}

.inc__body p:last-child {
  margin-bottom: 0;
}

.inc__body ul {
  margin: 0 0 8px;
  padding-left: 20px;
}

.inc__body code {
  font-family: var(--font-num);
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-sunk);
}

.crumb {
  margin: 0 0 14px;
  font-size: 13px;
}

/* --------------------------------------------------------------------------
 * Stale state. Shown when a background refresh has failed, so nobody reads a
 * frozen page as if it were live.
 * ----------------------------------------------------------------------- */

.is-stale .banner::after {
  content: "Live updates interrupted, reload to retry";
  position: absolute;
  right: 20px;
  bottom: -9px;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--warning);
  color: #17160f;
  font-size: 11px;
  font-weight: 620;
}

.is-stale .banner {
  position: relative;
}

/* --------------------------------------------------------------------------
 * Responsive
 * ----------------------------------------------------------------------- */

@media (max-width: 640px) {
  body {
    font-size: 14.5px;
  }

  .wrap {
    padding: 0 14px;
  }

  .head {
    padding: 24px 0 16px;
  }

  .banner {
    flex-wrap: wrap;
    padding: 16px 16px 15px;
  }

  .banner__title {
    font-size: 17px;
  }

  .banner__counts {
    width: 100%;
    justify-content: flex-start;
    gap: 0;
    padding-top: 12px;
    margin-top: 2px;
    border-top: 1px solid var(--border);
  }

  .chip {
    flex: 1 1 0;
    text-align: left;
    padding: 0 10px;
    border-left: none;
    border-right: 1px solid var(--border);
  }

  .chip:last-child {
    border-right: none;
  }

  .chip:first-child {
    padding-left: 0;
  }

  .card {
    padding: 15px 15px 13px;
  }

  /* 90 bars inside a phone's width needs the gap to give way, not the bars. */
  .uptime__bars {
    gap: 1px;
    height: 30px;
  }

  .day {
    border-radius: 1px;
  }

  .stats {
    gap: 6px;
  }

  .stat {
    padding: 7px 8px;
  }

  .stat__value {
    font-size: 14px;
  }

  .chart__meta {
    gap: 12px;
  }

  /* A nowrap tooltip is wider than the screen on a phone. Let it wrap and cap
   * it, otherwise it is clipped and unreadable exactly where it matters most. */
  [data-tip]::after {
    white-space: normal;
    width: max-content;
    max-width: 46vw;
  }
}

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

/* Forced colours, Windows high contrast. Status must survive the palette being
 * thrown away entirely, which is why every state also carries a word. */
@media (forced-colors: active) {
  .day,
  .swatch,
  .chart__fail {
    forced-color-adjust: none;
  }

  .card,
  .banner,
  .inc {
    border: 1px solid CanvasText;
  }
}
