/* lktec status - one stylesheet, system fonts, no external requests. Own palette and layout. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-soft: #f4f6f9;
  --fg: #17202a;
  --muted: #5b6675;
  --border: #d8dee6;
  --border-soft: #e9edf2;
  --link: #2457c5;
  --tip-bg: #ffffff;
  --tip-shadow: 0 10px 28px rgba(23, 32, 42, 0.14);
  --radius: 12px;

  /* Solid fills (white text on these passes WCAG AA). */
  --ok: #17804a;
  --minor: #8f6a00;
  --major: #b45309;
  --critical: #c42b3b;
  --maint: #5145cd;
  /* Bars are graphics (>= 3:1 against the page). */
  --none: #dde2e9;
  --bar-ok: #2f9e5f;
  --bar-minor: #d29b1d;
  --bar-major: #e5712a;
  --bar-critical: #d93a4b;
  --bar-maint: #6e63e0;
  /* Status text on the page background (>= 4.5:1). */
  --t-ok: #17804a;
  --t-minor: #8f6a00;
  --t-major: #b45309;
  --t-critical: #c42b3b;
  --t-maint: #5145cd;
  /* Tinted surfaces. */
  --tint-ok: #eaf6ef;
  --tint-minor: #fbf3dc;
  --tint-major: #fdeee3;
  --tint-critical: #fdebed;
  --tint-maint: #efeefd;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141a;
    --bg-soft: #161d26;
    --fg: #e4e9ef;
    --muted: #95a0ad;
    --border: #34404d;
    --border-soft: #222c37;
    --link: #79a6ff;
    --tip-bg: #19212b;
    --tip-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
    --ok: #1f7a47;
    --minor: #8a6400;
    --major: #a64a10;
    --critical: #b3303d;
    --maint: #4f46c8;
    --none: #29323d;
    --bar-ok: #2fa866;
    --bar-minor: #c99a1e;
    --bar-major: #e27532;
    --bar-critical: #e5525f;
    --bar-maint: #8a80f0;
    --t-ok: #4cc27f;
    --t-minor: #e2b340;
    --t-major: #f08a45;
    --t-critical: #ff6b77;
    --t-maint: #a29bff;
    --tint-ok: #12261b;
    --tint-minor: #2a2210;
    --tint-major: #2c1b10;
    --tint-critical: #2e1418;
    --tint-maint: #1d1b3a;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", Arial,
    sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

h1,
h2,
h3,
h4 {
  letter-spacing: -0.01em;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 4px;
}

code {
  font-family: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 0 4px;
}

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

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 8px;
  z-index: 10;
  background: var(--bg);
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* ------------------------------------------------------------------ masthead */

.masthead {
  border-bottom: 1px solid var(--border-soft);
}
.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-size: 21px;
  letter-spacing: -0.02em;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
}
.brand-mark rect {
  fill: var(--ok);
}
.brand-mark path {
  stroke: #ffffff;
}
.brand-name {
  font-weight: 750;
}
.brand-sub {
  font-weight: 400;
  color: var(--muted);
  margin-left: -4px;
}
.home-link {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
.home-link:hover {
  color: var(--fg);
}

main.wrap {
  padding-top: 36px;
  padding-bottom: 24px;
}

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

.banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 18px;
  font-weight: 650;
  margin-bottom: 32px;
}
.banner-operational {
  background: var(--tint-ok);
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
  color: var(--t-ok);
}
.banner-degraded {
  background: var(--tint-minor);
  border-color: color-mix(in srgb, var(--minor) 30%, transparent);
  color: var(--t-minor);
}
.banner-partial {
  background: var(--tint-major);
  border-color: color-mix(in srgb, var(--major) 30%, transparent);
  color: var(--t-major);
}
.banner-major {
  background: var(--tint-critical);
  border-color: color-mix(in srgb, var(--critical) 30%, transparent);
  color: var(--t-critical);
}
.banner-maintenance {
  background: var(--tint-maint);
  border-color: color-mix(in srgb, var(--maint) 30%, transparent);
  color: var(--t-maint);
}
.banner-icon {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex: none;
  background: currentColor;
}
.banner-operational .banner-icon::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 6px;
  width: 7px;
  height: 13px;
  border: solid var(--bg);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.banner:not(.banner-operational) .banner-icon::after {
  content: "!";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--bg);
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}

/* ------------------------------------------------------------------ active incident cards */

.incident-card {
  border: 1px solid var(--border);
  border-left-width: 5px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  background: var(--bg);
}
.incident-card.impact-minor {
  border-left-color: var(--bar-minor);
}
.incident-card.impact-major {
  border-left-color: var(--bar-major);
}
.incident-card.impact-critical {
  border-left-color: var(--bar-critical);
}
.incident-card.impact-none {
  border-left-color: var(--muted);
}
.incident-card-title {
  margin: 0;
  padding: 14px 20px 4px;
  font-size: 17px;
}
.incident-card.impact-minor .incident-card-title a {
  color: var(--t-minor);
}
.incident-card.impact-major .incident-card-title a {
  color: var(--t-major);
}
.incident-card.impact-critical .incident-card-title a {
  color: var(--t-critical);
}
.incident-card-body {
  padding: 0 20px 12px;
}
.update {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}
.update:last-of-type {
  border-bottom: 0;
}
.update time {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.impact-pill {
  display: inline-block;
  margin: 0 0 16px;
  padding: 2px 10px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 650;
}
.impact-pill.impact-minor {
  background: var(--minor);
}
.impact-pill.impact-major {
  background: var(--major);
}
.impact-pill.impact-critical {
  background: var(--critical);
}
.impact-pill.impact-maintenance {
  background: var(--maint);
}
.impact-pill.impact-none {
  background: var(--muted);
}

/* ------------------------------------------------------------------ planned maintenance */

.maintenance {
  margin-bottom: 32px;
  padding: 16px 18px 6px;
  border-radius: var(--radius);
  background: var(--tint-maint);
  border: 1px solid color-mix(in srgb, var(--maint) 25%, transparent);
}
.maintenance-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--t-maint);
}
.maintenance-title svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.mw-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mw {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid color-mix(in srgb, var(--maint) 18%, transparent);
}
.mw:first-child {
  border-top: 0;
  padding-top: 0;
}
.mw-date {
  flex: none;
  width: 52px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid color-mix(in srgb, var(--maint) 25%, transparent);
  text-align: center;
  overflow: hidden;
  align-self: flex-start;
}
.mw-month {
  display: block;
  background: var(--maint);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 0;
}
.mw-day {
  display: block;
  font-size: 20px;
  font-weight: 700;
  padding: 2px 0 4px;
}
.mw-main {
  min-width: 0;
  flex: 1;
}
.mw-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}
.mw-title {
  margin: 0;
  font-size: 16px;
}
.mw-title a {
  color: var(--fg);
}
.mw-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  background: var(--bg);
  color: var(--t-maint);
  border: 1px solid color-mix(in srgb, var(--maint) 30%, transparent);
}
.mw-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.mw-in-progress .mw-dot,
.mw-verifying .mw-dot {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--maint) 25%, transparent);
}
.mw-completed .mw-state {
  color: var(--t-ok);
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
}
.mw-completed .mw-month {
  background: var(--muted);
}
.mw-window {
  margin: 4px 0 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.mw-duration {
  color: var(--muted);
}
.mw-text {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.mw-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.mw-tags li {
  padding: 1px 9px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 12px;
}

/* ------------------------------------------------------------------ components */

.components {
  margin-bottom: 8px;
}
.components-intro {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}
.group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
  overflow: visible;
}
.group-name {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  border-bottom: 1px solid var(--border-soft);
}
.group-status {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: none;
}
.component {
  padding: 16px 20px 12px;
  border-top: 1px solid var(--border-soft);
}
.group-name + .component {
  border-top: 0;
}
.component-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.component-name {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}
.component-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.component-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.s-operational {
  color: var(--t-ok);
}
.s-degraded {
  color: var(--t-minor);
}
.s-partial {
  color: var(--t-major);
}
.s-major {
  color: var(--t-critical);
}
.s-maintenance {
  color: var(--t-maint);
}
.s-planned,
.s-unknown {
  color: var(--muted);
}
.group-status::before {
  display: none;
}

.help {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  cursor: help;
}
.help-tip {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 260px;
  padding: 8px 10px;
  background: var(--tip-bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--tip-shadow);
  font-size: 13px;
  font-weight: 400;
  z-index: 5;
}
.help:hover .help-tip,
.help:focus .help-tip {
  display: block;
}

/* ------------------------------------------------------------------ uptime bars */

.bars {
  display: flex;
  gap: 2px;
  height: 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bar {
  position: relative;
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 3px;
  background: var(--none);
  cursor: default;
}
.bar:hover,
.bar:focus {
  filter: brightness(0.85);
}
.b-ok {
  background: var(--bar-ok);
}
.b-minor {
  background: var(--bar-minor);
}
.b-major {
  background: var(--bar-major);
}
.b-critical {
  background: var(--bar-critical);
}
.b-maintenance {
  background: var(--bar-maint);
}

.tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 236px;
  padding: 10px 12px;
  background: var(--tip-bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--tip-shadow);
  font-size: 13px;
  line-height: 1.45;
  z-index: 5;
  pointer-events: none;
}
.tip-left .tip {
  left: 0;
  transform: none;
}
.tip-right .tip {
  left: auto;
  right: 0;
  transform: none;
}
.bar:hover .tip,
.bar:focus .tip {
  display: block;
}
.tip strong {
  display: block;
  margin-bottom: 2px;
}
.tip-quiet {
  display: block;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-soft);
  color: var(--muted);
}
.tip-incidents {
  margin: 6px 0 0;
  padding: 6px 0 0;
  list-style: none;
  border-top: 1px solid var(--border-soft);
}
.tip-incident {
  padding-left: 14px;
  position: relative;
}
.tip-incident::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--bar-minor);
}
.tip-incident.impact-major::before {
  background: var(--bar-major);
}
.tip-incident.impact-critical::before {
  background: var(--bar-critical);
}
.tip-incident.impact-maintenance::before {
  background: var(--bar-maint);
}

.bars-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}
.bars-legend .rule {
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}
.bars-legend .uptime {
  white-space: nowrap;
  font-weight: 600;
  color: var(--fg);
}
.span-60,
.span-30 {
  display: none;
}

/* Fewer days on narrow screens: 60 on tablets, 30 on phones. */
@media (max-width: 760px) {
  .bar:nth-child(-n + 30) {
    display: none;
  }
  .span-90 {
    display: none;
  }
  .span-60 {
    display: inline;
  }
}
@media (max-width: 520px) {
  .bar:nth-child(-n + 60) {
    display: none;
  }
  .span-60 {
    display: none;
  }
  .span-30 {
    display: inline;
  }
  .component,
  .group-name {
    padding-left: 14px;
    padding-right: 14px;
  }
  .banner {
    font-size: 16px;
  }
  .mw {
    gap: 12px;
  }
}

.checked {
  margin: 0 0 40px;
  color: var(--muted);
  font-size: 12px;
}

/* ------------------------------------------------------------------ history button */

.history-row {
  margin: 8px 0 0;
}
.history-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
}
.history-button::after {
  content: "";
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 2px 2px 0 0;
  transform: rotate(45deg);
}
.history-button:hover {
  text-decoration: none;
  border-color: var(--muted);
}
.quiet {
  color: var(--muted);
  margin: 0;
}
.meta {
  color: var(--muted);
  font-size: 13px;
}
.impact-text-minor a,
.impact-text-minor {
  color: var(--t-minor);
}
.impact-text-major a,
.impact-text-major {
  color: var(--t-major);
}
.impact-text-critical a,
.impact-text-critical {
  color: var(--t-critical);
}
.impact-text-maintenance a,
.impact-text-maintenance {
  color: var(--t-maint);
}

/* ------------------------------------------------------------------ incident + history pages */

.crumb {
  margin: 0 0 20px;
  font-size: 14px;
}
.page-title,
.incident-title {
  font-size: 26px;
  line-height: 1.25;
  margin: 0 0 10px;
}
.window {
  color: var(--muted);
  margin: 0 0 12px;
}
.updates {
  border-top: 1px solid var(--border-soft);
  margin-top: 12px;
}
.update-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-soft);
}
.update-status {
  font-weight: 650;
}
.update-text p {
  margin: 0 0 6px;
}
.affects {
  color: var(--muted);
  font-size: 14px;
}
@media (max-width: 520px) {
  .update-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
.month h2 {
  font-size: 18px;
  margin: 28px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-soft);
}
.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.history-item {
  margin-bottom: 16px;
}
.history-item h3 {
  font-size: 15px;
  margin: 0 0 2px;
}
.history-item p {
  margin: 0 0 2px;
}

/* ------------------------------------------------------------------ footer */

.footer {
  border-top: 1px solid var(--border-soft);
  margin-top: 40px;
  padding-top: 20px;
  padding-bottom: 40px;
  color: var(--muted);
  font-size: 13px;
}
.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 10px;
}
.footer p {
  margin: 0 0 6px;
}

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