.status-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 16px;
}

.status-header .wordmark {
  grid-column: 1;
  grid-row: 1;
}

.status-header .header-actions {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

.status-header .service-tabs {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  margin-left: 0;
}

.status-header .service-tab {
  flex: 1 0 72px;
}

.relay-filters {
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafafa;
  box-shadow: var(--shadow);
}

.relay-filters input,
.relay-filters select {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #dfe1e5;
  border-radius: 5px;
  outline: none;
  color: #343840;
  background: #fff;
  font-size: 11px;
}

.relay-filters input:focus,
.relay-filters select:focus {
  border-color: #aeb2b9;
  box-shadow: 0 0 0 3px rgba(17, 19, 24, .035);
}

.filter-row {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.relay-history {
  grid-template-columns: repeat(24, minmax(3px, 1fr));
  gap: 2px;
}

.relay-route-list {
  display: grid;
  gap: 7px;
}

.relay-route {
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #e7e9eb;
  border-radius: 6px;
  background: #fafbfb;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.relay-route-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.relay-route-main .component-dot { flex: 0 0 auto; }
.relay-route-main span:last-child { overflow: hidden; color: #40444c; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.relay-route-model { max-width: 190px; overflow: hidden; color: #8a8f99; font: 9px ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.relay-route-latency { color: #6f747e; font: 10px ui-monospace, monospace; }

.relay-source-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: #8a8f99;
  font-size: 10px;
}

.relay-source-line a { color: #4f5560; }

.relay-more {
  padding: 14px;
  border-top: 1px solid var(--divider);
  text-align: center;
}

.relay-more:has(button[hidden]) { display: none; }
.relay-empty { padding: 42px 18px; color: var(--faint); text-align: center; font-size: 12px; }

.contact-wrap { position: relative; }
.contact-button { cursor: pointer; font-family: inherit; }

.contact-card {
  position: absolute;
  z-index: 30;
  top: calc(100% + 11px);
  right: 0;
  width: min(310px, calc(100vw - 32px));
  padding: 17px;
  border: 1px solid #dfe1e5;
  border-radius: 10px;
  color: #343840;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 18px 48px rgba(20, 24, 34, .13), 0 2px 8px rgba(20, 24, 34, .06);
  text-align: left;
  transform-origin: top right;
  animation: contact-card-in 150ms ease-out;
  backdrop-filter: blur(12px);
}

.contact-card::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 54px;
  width: 9px;
  height: 9px;
  border-top: 1px solid #dfe1e5;
  border-left: 1px solid #dfe1e5;
  background: #fff;
  transform: rotate(45deg);
}

.contact-card[hidden] { display: none; }
.contact-profile { display: flex; align-items: center; gap: 12px; }

.contact-avatar {
  position: relative;
  width: 45px;
  height: 45px;
  border-radius: 14px;
  color: #fff;
  background: #202329;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

.contact-avatar span { font: 650 18px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.contact-avatar i { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border: 3px solid #fff; border-radius: 50%; background: #20b889; }
.contact-identity { min-width: 0; }
.contact-identity small { color: #9a9eaa; display: block; font: 600 8px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .1em; }
.contact-identity strong { margin-top: 5px; color: #24272d; display: block; font-size: 14px; font-weight: 650; }

.contact-card > p { margin: 15px 0; color: #6f747e; font-size: 12px; line-height: 1.7; }
.contact-card > p a { color: #252932; font-weight: 620; overflow-wrap: anywhere; text-decoration: underline; text-decoration-color: #c8ccd2; text-underline-offset: 3px; }

.contact-mail-button {
  min-height: 38px;
  padding: 9px 11px;
  border-radius: 7px;
  color: #fff;
  background: #202329;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 620;
  text-decoration: none;
  transition: background-color 120ms ease, transform 120ms ease;
}

.contact-mail-button:hover { background: #343840; transform: translateY(-1px); }
.contact-mail-button svg { width: 16px; height: 16px; }
.contact-mail-button b { margin-left: auto; font-size: 12px; font-weight: 500; }

@keyframes contact-card-in {
  from { opacity: 0; transform: translateY(-5px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
  .status-header .service-tab { min-width: 54px; padding: 0 5px; flex: 1 1 54px; font-size: 9px; }
  .filter-row { grid-template-columns: 1fr; }
  .relay-route { grid-template-columns: minmax(0, 1fr) auto; }
  .relay-route-model { display: none; }
  .relay-route-latency { font-size: 9px; }
  .relay-history { grid-template-columns: repeat(24, minmax(2px, 1fr)); }
  .contact-card { position: fixed; top: 62px; right: 16px; }
  .contact-card::before { right: 55px; }
}
