/* Nexar status page. No build step; colours follow the Internal Admin / dashboard palette. */
:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #5b6865;
  --line: #dce4e1;
  --paper: #ffffff;
  --wash: #f3f7f5;
  --brand: #146c52;
  --brand-dark: #0d4a39;
  --focus: #e19f20;
  --ok: #138a5e;
  --maint: #2867ad;
  --degraded: #b07800;
  --partial: #d0611b;
  --major: #b52a41;
  --unknown: #9aa5a2;
  --empty: #e3e9e7;
  --ok-soft: #e7f5ee;
  --maint-soft: #e8f0fa;
  --degraded-soft: #fbf3df;
  --partial-soft: #fcebdf;
  --major-soft: #fbe7ea;
  --unknown-soft: #eef1f0;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #e6efec;
    --muted: #a3b1ad;
    --line: #2c3a36;
    --paper: #16201d;
    --wash: #0e1513;
    --brand: #7df0b9;
    --brand-dark: #7df0b9;
    --ok: #4fd39a;
    --maint: #8fc1f8;
    --degraded: #edc777;
    --partial: #f4a26b;
    --major: #fca5af;
    --unknown: #6f7c78;
    --empty: #24302d;
    --ok-soft: #173327;
    --maint-soft: #1a2a3d;
    --degraded-soft: #3a3019;
    --partial-soft: #3b2619;
    --major-soft: #3d1f25;
    --unknown-soft: #222c29;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--wash);
  color: var(--ink);
  font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--brand-dark); text-underline-offset: 3px; }
a:focus-visible, main:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: .5rem 1rem; border-radius: 8px; }
.skip:focus { left: 16px; z-index: 3; }
.wrap { width: min(900px, calc(100% - 32px)); margin: 0 auto; }
.muted, .help { color: var(--muted); }
.help { font-size: .875rem; margin-top: .75rem; }

.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 800; color: var(--ink); text-decoration: none; font-size: 1.1rem; }
.brand-sub { font-weight: 500; color: var(--muted); }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: #146c52; color: #fff; }
.topbar-link { font-weight: 650; text-decoration: none; }

main { padding: 32px 0 16px; }
h1 { font-size: clamp(1.35rem, 3.5vw, 1.8rem); letter-spacing: -.02em; margin: 0; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 40px 0 14px; }

.banner { display: flex; gap: 16px; align-items: center; padding: 22px 24px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); }
.banner-detail { margin: .25rem 0 0; color: var(--muted); }
.banner-icon { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--unknown); box-shadow: 0 0 0 6px var(--unknown-soft); }
.banner.s-OPERATIONAL { background: var(--ok-soft); border-color: transparent; } .banner.s-OPERATIONAL .banner-icon { background: var(--ok); box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 20%, transparent); }
.banner.s-MAINTENANCE { background: var(--maint-soft); border-color: transparent; } .banner.s-MAINTENANCE .banner-icon { background: var(--maint); }
.banner.s-DEGRADED { background: var(--degraded-soft); border-color: transparent; } .banner.s-DEGRADED .banner-icon { background: var(--degraded); }
.banner.s-PARTIAL_OUTAGE { background: var(--partial-soft); border-color: transparent; } .banner.s-PARTIAL_OUTAGE .banner-icon { background: var(--partial); }
.banner.s-MAJOR_OUTAGE { background: var(--major-soft); border-color: transparent; } .banner.s-MAJOR_OUTAGE .banner-icon { background: var(--major); }
.banner.s-DELAYED, .banner.s-UNKNOWN { background: var(--unknown-soft); border-color: transparent; }

.note { margin: 16px 0 0; padding: 12px 16px; border-radius: 10px; background: var(--degraded-soft); }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.l-30 { display: none; }
.legend { display: flex; justify-content: space-between; width: min(360px, 45%); margin: 0; font-size: .75rem; color: var(--muted); }

.components { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.component { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.component:last-child { border-bottom: 0; }
.component-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.component-name { font-weight: 700; }
.component-desc { margin: .15rem 0 .7rem; color: var(--muted); font-size: .875rem; }
.status { display: inline-flex; align-items: center; gap: .45rem; font-weight: 650; font-size: .9rem; white-space: nowrap; }
.status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--unknown); }
.status.s-OPERATIONAL { color: var(--ok); } .status.s-OPERATIONAL::before { background: var(--ok); }
.status.s-MAINTENANCE { color: var(--maint); } .status.s-MAINTENANCE::before { background: var(--maint); }
.status.s-DEGRADED { color: var(--degraded); } .status.s-DEGRADED::before { background: var(--degraded); }
.status.s-PARTIAL_OUTAGE { color: var(--partial); } .status.s-PARTIAL_OUTAGE::before { background: var(--partial); }
.status.s-MAJOR_OUTAGE { color: var(--major); } .status.s-MAJOR_OUTAGE::before { background: var(--major); }
.status.s-UNKNOWN, .status.s-DELAYED { color: var(--muted); }

.bars { display: grid; grid-template-columns: repeat(90, 1fr); gap: 2px; height: 32px; }
.bar { display: block; border-radius: 2px; background: var(--empty); }
.bar.s-OPERATIONAL { background: var(--ok); }
.bar.s-MAINTENANCE { background: var(--maint); }
.bar.s-DEGRADED { background: var(--degraded); }
.bar.s-PARTIAL_OUTAGE { background: var(--partial); }
.bar.s-MAJOR_OUTAGE { background: var(--major); }
.uptime { display: flex; justify-content: space-between; margin-top: .35rem; font-size: .8rem; color: var(--muted); }

.incidents { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.incident { background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--unknown); border-radius: 12px; padding: 18px 20px; }
.incident.i-DEGRADED { border-left-color: var(--degraded); }
.incident.i-PARTIAL_OUTAGE { border-left-color: var(--partial); }
.incident.i-MAJOR_OUTAGE { border-left-color: var(--major); }
.incident.i-MAINTENANCE { border-left-color: var(--maint); }
.incident h3 { margin: 0; font-size: 1.05rem; }
.incident-meta { margin: .3rem 0 0; color: var(--muted); font-size: .875rem; }
.timeline { list-style: none; margin: 14px 0 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); display: grid; gap: 12px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -22px; top: .45rem; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); border: 2px solid var(--muted); }
.timeline strong { display: inline-block; margin-right: .4rem; }
.timeline p { margin: .15rem 0; white-space: pre-line; overflow-wrap: anywhere; }
.timeline time { color: var(--muted); font-size: .8rem; }
.past details summary { cursor: pointer; }

.footer { padding: 24px 0 48px; color: var(--muted); font-size: .875rem; }
.footer p { margin: .3rem 0; }

@media (max-width: 640px) {
  main { padding-top: 20px; }
  .banner { padding: 18px; }
  /* Phones show the last 30 days. */
  .bars { grid-template-columns: repeat(30, 1fr); }
  .bars .bar:nth-child(-n+60) { display: none; }
  .l-90 { display: none; }
  .l-30 { display: inline !important; }
  .legend { width: auto; gap: 12px; }
}
@media (prefers-reduced-motion: no-preference) {
  .banner-icon { transition: background .3s; }
}
