:root {
  --background: #0b0b0c;
  --surface: #0e0e10;
  --border: #1c1c1f;
  --separator: #17171a;
  --hover: #141416;
  --selected: #17171a;

  --text: #ededee;
  --text-secondary: #d6d6da;
  --text-muted: #84848c;
  --text-faint: #5b5b63;
  --text-dim: #4a4a52;

  --online: #4ec26f;
  --offline: #e05a4e;
  --warning: #d8a13a;
  --pending: #8f8f98;

  --series-1: #199e70;
  --series-2: #3987e5;
  --series-3: #d55181;
  --series-4: #d95926;
  --series-5: #c98500;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;

  --control-border: #2a2a2f;
  --danger-text: #e05a4e;
  --danger-border: #3a1f1f;
  --danger-hover: #1c1315;

  --font-ui: Archivo, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-card: 11px;
  --radius-control: 7px;
  --radius-small: 6px;

  --control-height: 32px;
  --control-height-small: 26px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--background);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-width: 320px;
}

::selection {
  background: #2a2a2e;
  color: #fff;
}

::-webkit-scrollbar {
  width: 9px;
}

::-webkit-scrollbar-thumb {
  background: #232326;
  border-radius: var(--radius-small);
}

::-webkit-scrollbar-track {
  background: transparent;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.page {
  max-width: 1560px;
  margin: 0 auto;
  padding: 36px 40px 64px;
  /* `backwards`, not `both`: a transform still in effect after the fade would
     make `.page` the box an expanded card is fixed and stacked against. */
  animation: fade-in 0.16s ease backwards;
}

.masthead {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 6px;
}

.status-dot {
  position: relative;
  top: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--online);
}

.service-name {
  margin: 0;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.service-status {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--online);
}

.service-description {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 60ch;
}

.pages {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 22px;
}

.pages a {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
}

.pages a:hover {
  background: var(--hover);
}

.pages a[aria-current="page"] {
  color: var(--text);
  background: var(--selected);
  border-color: var(--border);
}

.content {
  margin-top: 28px;
}

.content.tabbed {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.tabs {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 16px;
  border-right: 1px solid var(--border);
}

.tabs a {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: 7px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
}

.tabs a:hover {
  background: var(--hover);
}

.tabs a[aria-current="page"] {
  color: var(--text);
  background: var(--selected);
  border-left-color: var(--text);
}

.row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.column {
  grid-column: span var(--span, 12);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.column > .card {
  flex: 1 1 auto;
}

.colophon {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 40px 40px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.colophon a {
  color: var(--text-dim);
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px 20px;
}


.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 18px;
}

.card-expand {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1;
  width: var(--control-height-small);
  height: var(--control-height-small);
  margin: -5px -6px -5px 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.card:hover .card-expand,
.card-expand:focus-visible,
.card.expanded .card-expand {
  opacity: 1;
}

.card-expand:hover {
  color: var(--text);
  border-color: var(--control-border);
}

/* Viewing one widget: it fills the window above a dimmed dashboard. */
body.viewing {
  overflow: hidden;
}

body.viewing::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 8;
  background: rgb(0 0 0 / 0.6);
}

.card.expanded {
  position: fixed;
  inset: 24px;
  z-index: 9;
  overflow: hidden;
}

.card-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.card-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: 14px;
  height: 100%;
}

.card-body {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 60ch;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.card-actions button {
  font-size: 12.5px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-control);
  height: var(--control-height);
  padding: 0 12px;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s;
}

.card-actions button:hover {
  background: var(--hover);
}

.card-actions button.action-ok {
  border-color: var(--online);
  color: var(--online);
}

.card-actions button.action-error {
  border-color: var(--offline);
  color: var(--offline);
}

.toasts {
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 40px));
}

.toast {
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--offline);
  border-radius: var(--radius-control);
  cursor: pointer;
}

.toast strong {
  font-size: 13px;
  color: var(--text);
}

.toast p {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .page,
  .colophon {
    padding-left: 20px;
    padding-right: 20px;
  }

  .content.tabbed {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .tabs {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding: 0 0 8px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .tabs a {
    white-space: nowrap;
    border-left: none;
    border-radius: var(--radius-control);
  }

  .column {
    grid-column: span 12;
  }

}
