:root {
  color-scheme: dark;
  --bg: #111314;
  --panel: #1a1f20;
  --panel-2: #222829;
  --text: #e8ece9;
  --muted: #a9b3ad;
  --line: #343c3d;
  --accent: #74c69d;
  --accent-2: #a7c957;
  --danger: #ef476f;
  --warn: #ffd166;
  --down: #ff6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: #0d0f10;
}

.brand {
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
}

.nav,
.language-nav,
.actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.nav {
  flex: 1;
}

.language-nav a {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .2rem .45rem;
}

.container {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 2rem clamp(1rem, 4vw, 2rem);
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.1;
}

h2 {
  font-size: 1.15rem;
}

.narrow {
  max-width: 760px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.service-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: flex-start;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: .15rem .55rem;
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-block {
  display: grid;
  justify-items: end;
  gap: .35rem;
}

.timestamp {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  text-align: right;
}

.status-online {
  color: var(--accent-2);
}

.status-slow,
.status-unstable {
  color: var(--warn);
}

.status-down {
  color: var(--down);
}

.status-unknown {
  color: var(--muted);
}

.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
  margin: 1rem 0 0;
}

.meta.wide {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

dt {
  color: var(--muted);
  font-size: .82rem;
}

dd {
  margin: 0;
}

.stack {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: .35rem;
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .75rem;
  background: #0d0f10;
  color: var(--text);
  font: inherit;
}

textarea {
  resize: vertical;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  border: 1px solid #4d7c60;
  border-radius: 6px;
  padding: .55rem .85rem;
  background: #1f4f35;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

button:hover,
.button:hover {
  text-decoration: none;
  background: #286341;
}

.secondary {
  background: var(--panel-2);
  border-color: var(--line);
}

.danger {
  background: #4f1f2e;
  border-color: #7c3046;
}

.flash-list {
  display: grid;
  gap: .5rem;
  margin-bottom: 1rem;
}

.flash {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .75rem;
  background: var(--panel-2);
}

.flash-error {
  border-color: #7c3046;
}

.flash-success {
  border-color: #4d7c60;
}

.challenge-text,
.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.challenge-text {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem;
  background: #080909;
  white-space: pre-wrap;
}

.break {
  overflow-wrap: anywhere;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 2rem;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: .75rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.inline-form {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.inline-form select {
  width: auto;
  min-width: 150px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .75rem 0 1rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .45rem .65rem;
  background: var(--panel);
  color: var(--text);
}

.filter-chip.active {
  border-color: #4d7c60;
  background: #1f4f35;
}

.filter-chip span {
  color: var(--muted);
}

.action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  min-width: 220px;
}

.compact {
  min-height: 2rem;
  padding: .35rem .55rem;
  font-size: .9rem;
}

.comment-form {
  max-width: 760px;
  margin-bottom: 1rem;
}

.comment-list {
  display: grid;
  gap: .75rem;
}

.comment {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 1rem;
}

.comment header {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  color: var(--muted);
  margin-bottom: .5rem;
}

.comment p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.empty {
  color: var(--muted);
}

@media (max-width: 720px) {
  .page-head,
  .card-head {
    display: grid;
  }

  .status-block {
    justify-items: start;
  }

  .timestamp {
    text-align: left;
  }

  .topbar {
    align-items: flex-start;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}
