/* ============================================================
   PLAN4ME — status page
   Same tokens as plan4me.ai (styles.css): achromatic ramp, Inter,
   forest as the single accent. Self-contained so the status site
   never depends on the main site being up.
   ============================================================ */

:root {
  --bg: #fafafa;
  --card: #ffffff;
  --card-2: #ededed;
  --text: #171717;
  --muted: #5c5c5c;
  --line: #e6e6e6;
  --line-2: #f0f0f0;
  --ok: #1b5e20;
  --ok-soft: #eef3f0;
  --warn: #b26a00;
  --warn-soft: #fff4e0;
  --warn-cell: #e6a300;
  --bad: #b3261e;
  --bad-soft: #fdecec;
  --maint: #2b6cb0;
  --maint-soft: #e8f0fb;
  --none: #d9d9d9;
  --none-soft: #f0f0f0;
  --f-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --f-mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --r-sm: 8px;
  --r-md: 16px;
  --shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.08);
}

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

html {
  color-scheme: light;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.015em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--ok);
}
ul {
  list-style: none;
}
:focus-visible {
  outline: 2px solid var(--ok);
  outline-offset: 3px;
  border-radius: 4px;
}
[hidden] {
  display: none !important;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--text);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--r-sm);
}
.skip:focus {
  left: 8px;
  z-index: 10;
}

/* ---------- header ---------- */
.top {
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.03em;
}
.brand:hover {
  color: inherit;
}
.glyph {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.06em;
}
.brand__sub {
  color: var(--muted);
  font-weight: 500;
}
.top__links {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- layout ---------- */
.wrap {
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 20px 48px;
  flex: 1;
}
.block {
  margin-top: 40px;
}
.block__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.block__sub {
  color: var(--muted);
  font-size: 14px;
  flex-basis: 100%;
}

/* ---------- banner ---------- */
.banner {
  border-radius: var(--r-md);
  padding: 22px 24px;
  color: #fff;
  background: var(--muted);
  transition: background 0.3s ease;
}
.banner__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.banner h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.banner__meta {
  font-size: 14px;
  opacity: 0.85;
}
.banner--operational {
  background: var(--ok);
}
.banner--degraded {
  background: var(--warn);
}
.banner--down {
  background: var(--bad);
}
.banner--maintenance {
  background: var(--maint);
}
.banner--unknown,
.banner--loading {
  background: var(--muted);
}

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

/* ---------- pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.pill--ok {
  color: var(--ok);
  background: var(--ok-soft);
}
.pill--warn {
  color: var(--warn);
  background: var(--warn-soft);
}
.pill--bad {
  color: var(--bad);
  background: var(--bad-soft);
}
.pill--maint {
  color: var(--maint);
  background: var(--maint-soft);
}
.pill--none {
  color: var(--muted);
  background: var(--none-soft);
}

/* ---------- legend ---------- */
.legend {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
}
.legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.swatch {
  width: 10px;
  height: 14px;
  border-radius: 2px;
  display: inline-block;
}
.swatch--ok {
  background: var(--ok);
}
.swatch--warn {
  background: var(--warn-cell);
}
.swatch--bad {
  background: var(--bad);
}
.swatch--none {
  background: var(--none);
}

/* ---------- components ---------- */
.components {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.component {
  padding: 18px 20px 16px;
  border-top: 1px solid var(--line-2);
}
.component:first-child {
  border-top: 0;
}
.component__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.component__name {
  font-size: 16px;
  font-weight: 600;
}
.component__desc {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}
.component__detail {
  font-size: 13px;
  margin-top: 6px;
  color: var(--bad);
}
.component__detail--warn {
  color: var(--warn);
}
.component__detail--muted {
  color: var(--muted);
}
.bars {
  display: flex;
  gap: 2px;
  margin-top: 14px;
  height: 30px;
}
.cell {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 2px;
  background: var(--none);
  cursor: default;
  transition: transform 0.1s ease;
}
.cell:hover,
.cell:focus-visible {
  transform: scaleY(1.15);
  outline: none;
}
.cell--ok {
  background: var(--ok);
}
.cell--warn {
  background: var(--warn-cell);
}
.cell--bad {
  background: var(--bad);
}
.cell--none {
  background: var(--none);
}
.bars__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.bars__meta b {
  font-weight: 600;
  color: var(--text);
}
.skeleton .component__name,
.skeleton .component__desc {
  color: transparent;
  background: var(--line-2);
  border-radius: 4px;
}

/* ---------- dependencies ---------- */
.deps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.dep {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dep__name {
  font-weight: 600;
  font-size: 14px;
}
.dep__role {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}
.dep__detail {
  font-size: 12px;
  color: var(--warn);
  margin-top: 4px;
}
.dep a:hover {
  text-decoration: underline;
}

/* ---------- incidents ---------- */
.incidents {
  display: grid;
  gap: 12px;
}
.incident {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--bad);
  border-radius: var(--r-sm);
  padding: 16px 18px;
}
.incident--minor {
  border-left-color: var(--warn);
}
.incident--none {
  border-left-color: var(--muted);
}
.incident--maintenance {
  border-left-color: var(--maint);
}
.incident--resolved {
  border-left-color: var(--ok);
}
.incident__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.incident__title {
  font-size: 16px;
  font-weight: 600;
}
.incident__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.tag {
  font-size: 12px;
  color: var(--muted);
  background: var(--none-soft);
  border-radius: 999px;
  padding: 2px 8px;
}
.incident__when {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.updates {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}
.update {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  font-size: 14px;
}
.update__status {
  font-weight: 600;
  text-transform: capitalize;
}
.update__time {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.update__body {
  color: var(--text);
}
.update__body:empty::before {
  content: 'No details added.';
  color: var(--muted);
}

/* ---------- history ---------- */
.history {
  display: grid;
  gap: 4px;
}
.day {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.day:first-child {
  border-top: 0;
}
.day__date {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}
.day__none {
  font-size: 14px;
  color: var(--muted);
}
.history__older {
  margin-top: 24px;
}
.history__older h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}
.history .incidents {
  gap: 8px;
}

/* ---------- footer ---------- */
.foot {
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  display: grid;
  gap: 8px;
}
.foot a:hover {
  text-decoration: underline;
}

/* ---------- tooltip ---------- */
.tip {
  position: fixed;
  z-index: 20;
  pointer-events: none;
  background: var(--text);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: 6px;
  box-shadow: var(--shadow);
  max-width: 240px;
}
.tip b {
  font-weight: 600;
}

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .top {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .banner h1 {
    font-size: 20px;
  }
  .deps {
    grid-template-columns: 1fr;
  }
  .update {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .bars {
    height: 24px;
  }
  .legend {
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .banner,
  .cell {
    transition: none;
  }
}
