@font-face {
  font-family: 'Google Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/google-sans-cyrillic.woff2') format('woff2');
  unicode-range: U+301, U+400-45F, U+490-491, U+4B0-4B1, U+2116;
}

@font-face {
  font-family: 'Google Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/google-sans-latin.woff2') format('woff2');
  unicode-range:
    U+0-FF, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --page: #010101;
  --panel: #0a0a0a;
  --border: #242424;
  --text: #fff;
  --muted: #a7a7a7;
  --brand: #c6f432;
  --green: #8cdb9a;
  --orange: #ffb35b;
  --red: #ff828e;
  --gray: #999;
  font-family: 'Google Sans', system-ui, sans-serif;
  background: var(--page);
  color: var(--text);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --page: #f4f3ef;
    --panel: #fff;
    --border: #dfdcd4;
    --text: #12110f;
    --muted: #5f5b54;
    --green: #176638;
    --orange: #974900;
    --red: #b52b42;
    --gray: #6c6862;
  }
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
.layout {
  max-width: 840px;
  margin: auto;
  padding: 20px clamp(16px, 4vw, 38px) 64px;
}
header,
.brand,
.toolbar,
.card-head,
.card-foot,
nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
header,
.toolbar,
.card-head,
.card-foot {
  justify-content: space-between;
}
header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 17px;
}
a {
  color: inherit;
}
header a,
nav a {
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
header a:hover,
.toolbar > a:hover {
  text-decoration: underline;
}
.brand {
  font-size: 21px;
  font-weight: 680;
  letter-spacing: -0.05em;
}
.brand img {
  border-radius: 10px;
}
.quiet,
.card-foot {
  color: var(--muted);
  font-size: 14px;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: clamp(30px, 6vw, 48px);
  line-height: 1.03;
  letter-spacing: -0.05em;
}
h2 {
  font-size: clamp(16px, 3vw, 20px);
  letter-spacing: -0.025em;
}
.title {
  margin: 40px 0 24px;
}
.ok {
  --state: var(--green);
}
.degraded {
  --state: var(--orange);
}
.down {
  --state: var(--red);
}
.unknown {
  --state: var(--gray);
}
.summary {
  display: flex;
  gap: 14px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--state) 30%, var(--border));
  background: color-mix(in srgb, var(--state) 7%, var(--panel));
  padding: 17px;
  border-radius: 17px;
}
.summary h2 {
  margin-bottom: 4px;
}
.summary-icon {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  height: 36px;
  color: var(--state);
  background: color-mix(in srgb, var(--state) 15%, transparent);
  border-radius: 10px;
  font-size: 21px;
  font-weight: 740;
}
.toolbar {
  margin: 30px 0 12px;
  flex-wrap: wrap;
}
nav {
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
nav a {
  padding: 0 9px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--muted);
}
nav a[aria-current],
nav a:hover {
  background: var(--border);
  color: var(--text);
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 17px;
  padding: clamp(13px, 3vw, 20px);
  margin-bottom: 12px;
}
.card-head {
  flex-wrap: wrap;
  gap: 8px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--state);
  background: color-mix(in srgb, var(--state) 12%, transparent);
  border-radius: 20px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 650;
}
.badge i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--state);
}
.note {
  margin-top: 12px;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: clamp(1px, 0.4vw, 4px);
  margin: 15px 0 10px;
}
.bar {
  height: 22px;
  min-width: 0;
  border-radius: 3px;
  background: var(--state);
  opacity: 0.78;
}
.bar:hover {
  opacity: 1;
}
.bar.unknown {
  background: var(--border);
}
.card-foot strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
form,
label,
.field {
  display: grid;
  gap: 7px;
}
form {
  gap: 13px;
  margin-top: 16px;
}
input,
select,
textarea,
button {
  font: inherit;
  min-height: 44px;
  color: var(--text);
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}
button {
  justify-self: start;
  cursor: pointer;
  background: var(--brand);
  border: 0;
  color: #12110f;
  font-weight: 650;
}
.confirm {
  display: flex;
  align-items: center;
  min-height: 44px;
}
.confirm input {
  min-height: auto;
  width: 20px;
  height: 20px;
  accent-color: #659200;
}
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
main > h1:first-child {
  margin-block: 30px 16px;
}

.history-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0;
}

.history-controls nav {
  flex-wrap: wrap;
}
.history-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.history-form input {
  width: 82px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.history-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  margin: 16px 0 0;
  font-size: 14px;
}
.history-totals dt {
  color: var(--muted);
}
.history-totals dd {
  margin: 4px 0 0;
  font-weight: 650;
}
.history-events {
  margin-top: 12px;
}
.history-events summary {
  min-height: 44px;
  padding: 12px 0;
  cursor: pointer;
}
.history-events ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.history-events li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 5px 16px;
  border-top: 1px solid var(--border);
  padding: 9px 0;
  font-size: 14px;
}
