@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/inter.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("fonts/space-grotesk.woff2") format("woff2"); }

:root {
  --bg: #fbfcfd;
  --fg: #10131c;
  --muted: #4b5566;
  --faint: #8b93a3;
  --line: #e4e9f0;
  --tick-empty: #e3e8ef;
  --accent: #0f766e;
  --ok: #1e7a3e;
  --ok-tick: #2f8f53;
  --warn: #96590a;
  --warn-tick: #d08a1e;
  --bad: #c5221f;
  --bad-tick: #d6392f;
  --tip-bg: #10131c;
  --tip-fg: #eaeff6;
  --display: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  --text: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c11; --fg: #eaeff6; --muted: #96a1b2; --faint: #6b7686; --line: #1c2330;
    --tick-empty: #1a212c; --accent: #2dd4bf; --ok: #4ade80; --ok-tick: #2f9e5b;
    --warn: #f0b429; --warn-tick: #d99a26; --bad: #f87171; --bad-tick: #e5534b;
    --tip-bg: #eaeff6; --tip-fg: #10131c; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0c11; --fg: #eaeff6; --muted: #96a1b2; --faint: #6b7686; --line: #1c2330;
  --tick-empty: #1a212c; --accent: #2dd4bf; --ok: #4ade80; --ok-tick: #2f9e5b;
  --warn: #f0b429; --warn-tick: #d99a26; --bad: #f87171; --bad-tick: #e5534b;
  --tip-bg: #eaeff6; --tip-fg: #10131c; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 48px;
}
.wrap { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-block: 28px 4px; }
.mark { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--fg); }
.mark__name { font-family: var(--display); font-weight: 600; font-size: 20px; letter-spacing: -0.03em; }
.mark__page { color: var(--muted); }
.checked { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.checked.is-stale { color: var(--warn); }

.verdict { display: flex; gap: 14px; align-items: flex-start; padding-block: 28px 8px; }
.glyph { flex: none; width: 34px; height: 34px; margin-top: 2px; }
.verdict h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(24px, 5vw, 30px); letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
.verdict p { margin: 4px 0 0; color: var(--muted); max-width: 60ch; }

section.block { padding-block: 28px 0; display: flex; flex-direction: column; gap: 12px; }
.head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.head h2 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.head span { font-size: 13px; color: var(--faint); }

.ticks { position: relative; display: grid; grid-template-columns: repeat(90, 1fr); gap: 2px; height: 40px; touch-action: pan-y; }
.tick { border-radius: 2px; background: var(--tick-empty); }
.tick[data-s="ok"] { background: var(--ok-tick); }
.tick[data-s="warn"] { background: var(--warn-tick); }
.tick[data-s="bad"] { background: var(--bad-tick); }
.tick.is-hot { outline: 2px solid var(--fg); outline-offset: 1px; }
.axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); }
.tip {
  position: absolute; bottom: calc(100% + 10px); transform: translateX(-50%);
  background: var(--tip-bg); color: var(--tip-fg); font-size: 12.5px; line-height: 1.45;
  padding: 8px 10px; border-radius: 7px; width: max-content; max-width: 240px; pointer-events: none; z-index: 2;
}
.tip b { display: block; font-weight: 600; }

.groups { list-style: none; margin: 0; padding: 0; }
.groups li { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 2px 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.groups li:first-child { border-top: 0; }
.groups .state { font-size: 14px; font-weight: 500; }
.groups__names { color: var(--muted); font-size: 14px; min-width: 0; }

.state { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.state::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.state[data-s="degraded"] { color: var(--warn); }
.state[data-s="degraded"]::before { background: var(--warn); }
.state[data-s="down"] { color: var(--bad); }
.state[data-s="down"]::before { background: var(--bad); }
.state[data-s="unknown"] { color: var(--faint); }
.state[data-s="unknown"]::before { background: var(--faint); }

.svc { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
.svc li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 9px 0; border-top: 1px solid var(--line); min-width: 0; }
.svc li:nth-child(-n+2) { border-top: 0; }
.svc__name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc__mini { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(90, 1fr); gap: 1px; height: 6px; }
.svc__mini span { background: var(--tick-empty); border-radius: 1px; }
.svc__mini span[data-s="ok"] { background: var(--ok-tick); opacity: 0.55; }
.svc__mini span[data-s="warn"] { background: var(--warn-tick); }
.svc__mini span[data-s="bad"] { background: var(--bad-tick); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: 13px; }

.figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fig { padding: 14px 14px 14px 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fig + .fig { padding-left: 14px; border-left: 1px solid var(--line); }
.fig__label { font-size: 12.5px; color: var(--muted); }
.fig__value { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.fig__note { font-size: 12px; color: var(--faint); }

.day { position: relative; display: flex; flex-direction: column; gap: 14px; touch-action: pan-y; }
.day .guide { stroke: var(--fg); stroke-width: 1; opacity: 0.45; }
.tip--day { bottom: auto; transform: translate(-50%, -100%); min-width: 200px; }
.tip__row { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }
.tip__row span:first-child { opacity: 0.75; }
.day svg { display: block; width: 100%; height: auto; overflow: visible; }
.panel { display: flex; flex-direction: column; gap: 6px; }
.panel__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; color: var(--muted); }
.panel__head b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.day .blk-none { fill: var(--tick-empty); }
.day .blk-ok { fill: var(--ok-tick); }
.day .blk-warn { fill: var(--warn-tick); }
.day .blk-bad { fill: var(--bad-tick); }
.day .grid { stroke: var(--line); }
.day .area { fill: var(--accent); opacity: 0.12; }
.day .line { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.day .end { fill: var(--accent); }
.day .rel { stroke: var(--fg); stroke-width: 1; stroke-dasharray: 2 2; opacity: 0.55; }
.day .rel-dot { fill: var(--bg); stroke: var(--fg); stroke-width: 1.5; }
.day text { fill: var(--faint); font: 11px var(--text); font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--muted); }
.legend i, .head .k-rel { display: inline-block; vertical-align: middle; margin-right: 6px; }
.k-line { width: 14px; height: 0; border-top: 2px solid var(--accent); }
.k-line--alt { border-top: 2px dashed var(--faint); }
.day .line--alt { stroke: var(--faint); stroke-dasharray: 3 3; }
.k-rel { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--fg); }

.inc { list-style: none; margin: 0; padding: 0; }
.inc li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 2px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.inc li:first-child { border-top: 0; }
.inc__date { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.inc__title { font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sev { font-size: 11px; font-weight: 600; letter-spacing: 0.03em; padding: 1px 7px; border-radius: 999px; }
.sev[data-s="bad"] { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.sev[data-s="warn"] { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.inc__body { grid-column: 2; color: var(--muted); font-size: 14px; margin: 0; }
.inc__meta { grid-column: 2; font-size: 12.5px; color: var(--faint); margin: 0; font-variant-numeric: tabular-nums; }
.inc li.inc__none { display: block; color: var(--muted); font-size: 14px; padding: 4px 0; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding-top: 36px; font-size: 12.5px; color: var(--faint); }

@media (max-width: 560px) {
  .groups li { grid-template-columns: minmax(0, 1fr); }
  .svc { grid-template-columns: minmax(0, 1fr); }
  .svc li:nth-child(2) { border-top: 1px solid var(--line); }
  .figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fig:nth-child(3) { border-left: 0; padding-left: 0; }
  .fig:nth-child(n+3) { border-top: 1px solid var(--line); }
  .ticks { gap: 1px; height: 34px; }
  .inc li { grid-template-columns: minmax(0, 1fr); }
  .inc__body, .inc__meta { grid-column: 1; }
  .top { flex-direction: column; gap: 2px; }
  .checked { text-align: left; }
}
@media (prefers-reduced-motion: no-preference) {
  .tick, .svc__mini span { transition: background-color 0.2s; }
}
