:root {
  color-scheme: light;
  font-family: "Segoe UI", sans-serif;
  font-size: 15px;
  background: #f3f5f7;
  color: #1c2430;
}

body {
  margin: 0;
}

header, main {
  width: min(1180px, calc(100% - 1.5rem));
  margin: 0 auto;
}

header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.75rem 0;
}

.brand {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

nav a {
  color: #1c2430;
  text-decoration: none;
}

nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
}

.session {
  margin-left: auto;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.session form,
td form,
.inline {
  border: 0;
  padding: 0;
  background: transparent;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

main {
  padding-bottom: 2rem;
}

h1 {
  font-size: 1.35rem;
  margin: 0.2rem 0 0.4rem;
}

h2 {
  font-size: 1.05rem;
  margin: 1.2rem 0 0.4rem;
}

form, table, .card, .banner, .stats a, .stats div {
  background: #fff;
  border: 1px solid #d5dbe3;
  border-radius: 8px;
}

form {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  padding: 0.75rem;
}

form[hidden] {
  display: none;
}

form.filters, form.stack {
  flex-wrap: wrap;
  align-items: end;
}

form.stack {
  flex-direction: column;
  align-items: stretch;
  max-width: 36rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 8rem;
}

label.check {
  flex-direction: row;
  align-items: center;
  min-width: 0;
}

input, select, button {
  font: inherit;
  padding: 0.35rem 0.5rem;
}

button {
  cursor: pointer;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 0.75rem;
}

#domain-list {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

#domain-list .table-wrap {
  min-width: 0;
  max-width: 100%;
}

#domain-list th,
#domain-list td {
  white-space: normal;
}

#domain-list th:nth-child(2),
#domain-list td:nth-child(2) {
  min-width: 12rem;
}

#domain-list td:nth-child(2) a {
  overflow-wrap: anywhere;
}

#domain-list th:first-child,
#domain-list td:first-child,
#domain-list th:last-child,
#domain-list td:last-child {
  width: 1%;
  white-space: nowrap;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  margin-top: 0;
}

th, td {
  text-align: left;
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid #e6ebf1;
  vertical-align: top;
  white-space: nowrap;
}

td:nth-child(2), th:nth-child(2) {
  white-space: normal;
}

table a {
  color: inherit;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.stats a, .stats div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.7rem;
  text-decoration: none;
  color: inherit;
}

.stats strong {
  font-size: 1.35rem;
}

.banner {
  padding: 0.7rem 0.85rem;
}

.banner p {
  margin: 0.3rem 0 0;
}

.banner-live { border-color: #8fceaa; }
.banner-stale, .banner-waiting { border-color: #e0b15a; background: #fff8ec; }
.banner-idle { border-color: #c5ced8; }

.pill {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: #e8edf2;
  font-size: 0.85rem;
}

.pill-up { background: #dff5e8; }
.pill-down { background: #fde2e2; }
.pill-suspected { background: #fff1d6; }
.pill-recovering { background: #e3efff; }
.pill-paused { background: #eceff3; }

.row-down { background: #fff5f5; }
.row-suspected { background: #fffaf0; }

.error, .error-block {
  color: #8d1d1d;
}

.flash {
  color: #0d5c32;
}

.meta, .summary {
  color: #3d4b5c;
}

.pages {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 0.8rem;
}

.card {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 0.35rem 1rem;
  padding: 0.8rem 1rem;
}

.card dt {
  color: #3d4b5c;
}

.card dd {
  margin: 0;
}

.panel {
  margin: 0.6rem 0;
}

.bulk {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.6rem;
}

.bulk-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  width: 100%;
}

details.panel > form {
  margin-top: 0.4rem;
}

code {
  font-family: Consolas, monospace;
}

@media (max-width: 720px) {
  .card {
    grid-template-columns: 1fr;
  }

  .session {
    margin-left: 0;
  }

  form.filters {
    align-items: stretch;
  }

  label {
    width: 100%;
  }
}
