/* Health / status page */
.health-page {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding:
    var(--cloud-header-offset)
    var(--layout-gutter)
    clamp(3rem, 8vw, 5rem);
}

.health-hero h1 {
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  margin: 0 0 0.45rem;
  letter-spacing: -0.02em;
}

.health-hero .cloud-page__lead {
  max-width: 36rem;
}

.health-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
  margin: 1.1rem 0 0;
  font-size: 0.875rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.55);
}

.health-status-line__label {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
}

.health-status-line.is-ok .health-status-line__label {
  color: var(--success);
}

.health-status-line.is-degraded .health-status-line__label {
  color: #ffcc00;
}

.health-status-line.is-down .health-status-line__label {
  color: var(--danger);
}

.health-status-line__sep {
  color: rgba(255, 255, 255, 0.28);
}

.health-status-line__meta {
  color: rgba(255, 255, 255, 0.42);
}

.health-badge {
  font-family: var(--font-meta);
  font-size: 0.625rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.35rem 0.6rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  white-space: nowrap;
}

.health-badge.is-ok {
  border-color: rgba(48, 209, 88, 0.35);
  color: var(--success);
}

.health-badge.is-degraded {
  border-color: rgba(255, 204, 0, 0.35);
  color: #ffcc00;
}

.health-badge.is-bad,
.health-badge.is-down {
  border-color: rgba(255, 69, 58, 0.35);
  color: var(--danger);
}

.health-section {
  margin-top: 2.25rem;
}

.health-section__head {
  margin-bottom: 0.85rem;
}

.health-section__head h2 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.health-section__hint {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.42);
}

.health-regions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

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

.health-region {
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  padding: 0.9rem 1rem;
  background: var(--panel);
  min-height: 5.5rem;
}

.health-region__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.health-region__name {
  font-size: 0.875rem;
  font-weight: 600;
}

.health-region__code {
  font-family: var(--font-meta);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.health-region__status {
  margin: 0.45rem 0 0;
  font-family: var(--font-meta);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.health-region__status.is-ok {
  color: var(--success);
}

.health-region__status.is-degraded {
  color: #ffcc00;
}

.health-region__status.is-down {
  color: var(--danger);
}

.health-region__meta {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.42);
}

.health-region__bars {
  margin-top: 0.65rem;
}

.health-components {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--panel);
  overflow: hidden;
}

.health-component {
  padding: 1rem 1.15rem 1.05rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.health-component:last-child {
  border-bottom: none;
}

.health-component__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.health-component__label {
  font-size: 0.9375rem;
  font-weight: 500;
}

.health-component__desc {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.42);
  max-width: 28rem;
}

.health-component__right {
  text-align: right;
  flex-shrink: 0;
}

.health-component__state {
  font-family: var(--font-meta);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.health-component__state.is-ok {
  color: var(--success);
}

.health-component__state.is-bad {
  color: var(--danger);
}

.health-component__uptime {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.4);
}

.health-bars {
  display: grid;
  grid-template-columns: repeat(90, minmax(0, 1fr));
  gap: 1px;
  margin-top: 0.75rem;
  height: 1.65rem;
}

.health-bars__cell {
  border-radius: 1px;
  background: rgba(48, 209, 88, 0.55);
  min-width: 0;
  padding: 0;
  border: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 100%;
  cursor: default;
}

.health-bars__cell.is-clickable {
  cursor: pointer;
}

.health-bars__cell.is-clickable:hover,
.health-bars__cell.is-clickable:focus-visible {
  outline: none;
  filter: brightness(1.25);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.health-bars__cell.is-active {
  filter: brightness(1.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.health-bars__cell.is-partial {
  background: rgba(255, 204, 0, 0.65);
}

.health-bars__cell.is-down {
  background: rgba(255, 69, 58, 0.75);
}

.health-bars__cell.is-none {
  background: rgba(255, 255, 255, 0.08);
}

.health-bars__legend {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.625rem;
  color: rgba(255, 255, 255, 0.32);
  font-family: var(--font-meta);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.health-meta {
  padding: 0.85rem 1.15rem;
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.health-feed {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--panel);
  overflow: hidden;
}

.health-feed__empty {
  margin: 0;
  padding: 1.25rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.45);
}

.health-feed__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.health-feed__item {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  scroll-margin-top: calc(var(--cloud-header-offset, 4rem) + 1rem);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.health-feed__item:last-child {
  border-bottom: none;
}

.health-feed__item.is-selected {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.55);
}

.health-feed__item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.75rem;
}

.health-feed__kind {
  font-family: var(--font-meta);
  font-size: 0.625rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255, 69, 58, 0.9);
}

.health-feed__item--maintenance .health-feed__kind {
  color: rgba(255, 204, 0, 0.9);
}

.health-feed__service,
.health-feed__regions,
.health-feed__dur {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.4);
}

.health-feed__title {
  margin: 0.35rem 0 0;
  font-size: 0.9375rem;
  font-weight: 500;
}

.health-feed__when,
.health-feed__summary {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.48);
}

/* Legacy maintenance slot on status page */
.health-maintenance {
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(255, 204, 0, 0.28);
  border-radius: 0.65rem;
  background: rgba(255, 204, 0, 0.06);
}

.health-maintenance__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
}

.health-maintenance__reason {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
}

.health-maintenance__meta {
  margin: 0.3rem 0 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
}

.security-page .security-prose {
  margin-top: 1.5rem;
}

.security-page .security-prose h2 {
  font-size: 1.0625rem;
  margin: 1.5rem 0 0.65rem;
}

.security-page .security-prose h2:first-child {
  margin-top: 0;
}

.security-page .security-prose p,
.security-page .security-prose li {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.68);
}

.security-page .security-prose ul,
.security-page .security-prose ol {
  margin: 0.4rem 0 1rem;
  padding-left: 1.2rem;
}

.security-page .security-prose a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.security-page code {
  font-size: 0.875em;
}
