* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #1f2933;
  background: #f6f7f9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

p {
  margin: 6px 0 0;
  color: #52606d;
  line-height: 1.5;
}

.health {
  flex: 0 0 auto;
  min-width: 92px;
  padding: 8px 10px;
  border: 1px solid #cbd2d9;
  background: #fff;
  border-radius: 8px;
  text-align: center;
  font-size: 13px;
  color: #52606d;
}

.health.ok {
  border-color: #65a30d;
  color: #3f6212;
}

.health.bad {
  border-color: #dc2626;
  color: #991b1b;
}

.search {
  display: grid;
  grid-template-columns: 1fr 150px 130px 108px;
  gap: 12px;
  align-items: end;
  padding: 14px;
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #52606d;
}

input,
select,
button {
  height: 42px;
  border-radius: 8px;
  border: 1px solid #bcccdc;
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 0 12px;
  color: #1f2933;
  background: #fff;
}

button {
  border: 0;
  color: #fff;
  background: #2563eb;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  background: #9fb3c8;
  cursor: wait;
}

.status {
  min-height: 42px;
  margin: 14px 0;
  padding: 11px 13px;
  background: #eef2ff;
  color: #334e68;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
}

.status.ok {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.status.bad {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.status.loading {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.panel {
  min-width: 0;
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #e4e7eb;
  background: #f8fafc;
}

h2 {
  margin: 0;
  font-size: 16px;
}

.panel-head span {
  min-width: 28px;
  height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  text-align: center;
  font-weight: 700;
}

.list {
  display: grid;
  gap: 0;
}

.list.empty {
  padding: 28px 14px;
  color: #829ab1;
  text-align: center;
}

.item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #edf1f5;
}

.item:last-child {
  border-bottom: 0;
}

.rank {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #e4e7eb;
  color: #334e68;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.content {
  min-width: 0;
}

.line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  font-size: 13px;
}

.line strong {
  color: #102a43;
}

.line span {
  color: #627d98;
}

.item p {
  margin: 7px 0;
  color: #334e68;
  font-size: 13px;
}

.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.metrics span,
.reason {
  padding: 4px 7px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #52606d;
  font-size: 12px;
}

.reason {
  display: inline-block;
  margin-bottom: 8px;
}

a {
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

  .search {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 20px, 1440px);
    padding-top: 18px;
  }

  .topbar {
    display: grid;
  }

  .search {
    grid-template-columns: 1fr;
  }
}
