[data-status="operational"],
[data-tone="ok"] {
  --tone-text: var(--status-ok-text);
  --tone-bg: var(--status-ok-bg);
  --tone-border: var(--status-ok-border);
  --tone-solid: var(--status-ok-solid);
}

[data-status="degraded"],
[data-tone="warn"] {
  --tone-text: var(--status-warn-text);
  --tone-bg: var(--status-warn-bg);
  --tone-border: var(--status-warn-border);
  --tone-solid: var(--status-warn-solid);
}

[data-status="outage"],
[data-status="partial_outage"],
[data-status="major_outage"],
[data-tone="critical"] {
  --tone-text: var(--status-critical-text);
  --tone-bg: var(--status-critical-bg);
  --tone-border: var(--status-critical-border);
  --tone-solid: var(--status-critical-solid);
}

[data-status="maintenance"],
[data-tone="maintenance"] {
  --tone-text: var(--status-maintenance-text);
  --tone-bg: var(--status-maintenance-bg);
  --tone-border: var(--status-maintenance-border);
  --tone-solid: var(--status-maintenance-solid);
}

[data-status="unknown"],
[data-status="loading"],
[data-tone="unknown"] {
  --tone-text: var(--status-unknown-text);
  --tone-bg: var(--status-unknown-bg);
  --tone-border: var(--status-unknown-border);
  --tone-solid: var(--status-unknown-solid);
}

[data-tone="info"] {
  --tone-text: var(--status-info-text);
  --tone-bg: var(--status-info-bg);
  --tone-border: var(--status-info-border);
  --tone-solid: var(--status-info-solid);
}

.section {
  scroll-margin-top: calc(var(--header-height) + 1.25rem);
}

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

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.section__head-text {
  min-width: 0;
}

.section__title {
  color: var(--text);
  font-size: var(--text-lg);
  font-weight: 680;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.section__lead {
  max-width: 64ch;
  margin-top: 0.3rem;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
  text-wrap: pretty;
}

.section__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.section__meta {
  display: inline-flex;
  align-items: center;
  min-height: 1.85rem;
  padding: 0 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.26rem 0.55rem;
  border: 1px solid var(--tone-border, var(--border-strong));
  border-radius: var(--radius-pill);
  background: var(--tone-bg, var(--surface-2));
  color: var(--tone-text, var(--text-secondary));
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 1.15;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  flex: none;
  border-radius: 50%;
  background: var(--tone-solid, var(--status-unknown-solid));
}

.badge--overall {
  font-size: var(--text-xs);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.tag--main {
  border-color: var(--status-maintenance-border);
  background: var(--status-maintenance-bg);
  color: var(--status-maintenance-text);
}

.notice {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--status-warn-border);
  border-radius: var(--radius-md);
  background: var(--status-warn-bg);
  color: var(--status-warn-text);
}

.notice[data-tone="error"] {
  border-color: var(--status-critical-border);
  background: var(--status-critical-bg);
  color: var(--status-critical-text);
}

.notice__body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.notice__message {
  font-size: var(--text-sm);
  font-weight: 550;
  line-height: 1.5;
}

.notice .btn {
  border-color: currentColor;
  color: inherit;
  opacity: 0.9;
}

.hero__notice {
  margin-top: 1rem;
}

.service-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.875rem;
}

.service-grid__item {
  min-width: 0;
}

.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  height: 100%;
  min-width: 0;
  padding: 1.05rem 1.05rem 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color var(--duration-fast) var(--ease-soft), box-shadow var(--duration-base) var(--ease-soft);
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--tone-solid, var(--status-unknown-solid));
  opacity: 0.85;
}

.service-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}

.service-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.service-card__identity {
  min-width: 0;
}

.service-card__name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.service-card__name {
  color: var(--text);
  font-size: var(--text-md);
  font-weight: 650;
  letter-spacing: -0.012em;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.service-card__host {
  margin-top: 0.18rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.service-card__note {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.service-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.service-metric {
  min-width: 0;
}

.service-metric__label {
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.service-metric__value {
  margin-top: 0.15rem;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.service-metric__value--mono {
  font-family: var(--font-mono);
}

.service-metric[data-http-class="client"] .service-metric__value,
.service-metric[data-http-class="server"] .service-metric__value {
  color: var(--status-warn-text);
}

.service-metric[data-http-class="server"] .service-metric__value {
  color: var(--status-critical-text);
}

.service-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.75rem;
  margin-top: auto;
}

.service-card__checked {
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: 1.4;
}

.service-card__checked time {
  color: var(--text-secondary);
  font-weight: 600;
}

.tls-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.45rem;
  border: 1px solid var(--tone-border, var(--border));
  border-radius: var(--radius-sm);
  background: var(--tone-bg, var(--surface-2));
  color: var(--tone-text, var(--text-muted));
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.period-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
}

.period-switch__button {
  min-height: 1.95rem;
  padding: 0 0.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 650;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-soft), color var(--duration-fast) var(--ease-soft), border-color var(--duration-fast) var(--ease-soft);
}

.period-switch__button:hover {
  color: var(--text);
}

.period-switch__button[aria-pressed="true"] {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend__swatch {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 2px;
  background: var(--tone-solid, var(--status-unknown-solid));
}

.legend__swatch[data-measured="false"] {
  background: repeating-linear-gradient(135deg, var(--border-strong) 0 2px, transparent 2px 4px);
  box-shadow: inset 0 0 0 1px var(--border);
}

.uptime-panels {
  display: grid;
  gap: 0.875rem;
}

.uptime-panel {
  min-width: 0;
  padding: 1rem 1.05rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.uptime-panel--skeleton {
  display: grid;
  gap: 0.7rem;
  min-height: 8.5rem;
}

.uptime-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.uptime-panel__identity {
  min-width: 0;
}

.uptime-panel__name {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.uptime-panel__host {
  margin-top: 0.12rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}

.uptime-panel__summary {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  white-space: nowrap;
}

.uptime-panel__value {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.uptime-panel__period {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.timeline {
  margin-top: 0.75rem;
  border-radius: var(--radius-sm);
}

.timeline:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.timeline__track {
  display: flex;
  gap: 2px;
  height: 2.35rem;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.timeline__bucket {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 2px;
  background: var(--tone-solid, var(--status-unknown-solid));
  opacity: 0.92;
  transition: opacity var(--duration-fast) var(--ease-soft), box-shadow var(--duration-fast) var(--ease-soft);
}

.timeline__bucket[data-measured="false"] {
  background: repeating-linear-gradient(135deg, var(--border-strong) 0 2px, transparent 2px 5px);
  box-shadow: inset 0 0 0 1px var(--border);
  opacity: 1;
}

.timeline__bucket.is-active {
  position: relative;
  z-index: 1;
  opacity: 1;
  box-shadow: 0 0 0 1px var(--surface), 0 0 0 2px var(--text);
}

.timeline__scale {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
}

.timeline__scale-label {
  white-space: nowrap;
}

.timeline__detail {
  min-height: 2.6em;
  margin-top: 0.25rem;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.timeline.is-empty .timeline__track {
  display: none;
}

.timeline.is-empty .timeline__scale {
  display: none;
}

.timeline.is-empty .timeline__detail {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.incident-list {
  display: grid;
  gap: 0.75rem;
}

.incident {
  min-width: 0;
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-lg);
}

.incident[data-severity="minor"] {
  border-left-color: var(--status-warn-solid);
}

.incident[data-severity="major"] {
  border-left-color: var(--status-critical-solid);
}

.incident[data-severity="critical"] {
  border-left-color: var(--status-critical-solid);
}

.incident[data-severity="maintenance"] {
  border-left-color: var(--status-maintenance-solid);
}

.incident[data-severity="info"] {
  border-left-color: var(--status-info-solid);
}

.incident[data-active="true"] {
  border-left-color: var(--status-warn-solid);
}

.incident[data-active="true"][data-severity="major"],
.incident[data-active="true"][data-severity="critical"] {
  border-left-color: var(--status-critical-solid);
}

.incident__card {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.95rem 1rem 1rem;
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.incident__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.75rem;
}

.incident__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.incident__started {
  color: var(--text-muted);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.incident__title {
  color: var(--text);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.012em;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.incident__service {
  color: var(--text-muted);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.incident__service-label {
  color: var(--text-secondary);
  font-weight: 600;
}

.incident__description {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.6;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.incident__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.5rem 1rem;
  margin-top: 0.2rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

.incident__meta-item {
  min-width: 0;
}

.incident__meta-item dt {
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.incident__meta-item dd {
  margin-top: 0.12rem;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.state {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.state--error {
  border-style: solid;
  border-color: var(--status-critical-border);
  background: var(--status-critical-bg);
}

.state--empty {
  border-style: dashed;
  background: var(--surface-2);
}

.state--loading {
  border-style: solid;
  border-color: var(--border);
  background: var(--surface-2);
}

.state__icon {
  position: relative;
  flex: none;
  width: 1.85rem;
  height: 1.85rem;
  margin-top: 0.1rem;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
}

.state__icon::after {
  content: "";
  position: absolute;
  inset: 0.52rem;
  border-radius: 50%;
  background: var(--status-unknown-solid);
  opacity: 0.65;
}

.state--error .state__icon {
  border-color: var(--status-critical-border);
}

.state--error .state__icon::after {
  background: var(--status-critical-solid);
}

.state--empty .state__icon::after {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--border-strong);
}

.state__body {
  min-width: 0;
}

.state__title {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.35;
}

.state__message {
  margin-top: 0.15rem;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.state__action {
  margin-top: 0.65rem;
}

.skeleton {
  display: block;
  height: 0.85rem;
  border-radius: var(--radius-xs);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.service-card--skeleton {
  display: grid;
  gap: 0.7rem;
  min-height: 10.5rem;
  padding: 1.15rem;
}

.skeleton--title {
  width: 58%;
  height: 1.05rem;
}

.skeleton--text {
  width: 72%;
}

.skeleton--short {
  width: 42%;
}

.skeleton--metrics {
  width: 100%;
  height: 3.2rem;
  margin-block: 0.35rem;
}

.skeleton--chart {
  width: 100%;
  height: 2.35rem;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.site-footer__inner {
  display: grid;
  gap: 1.25rem;
  width: 100%;
  max-width: var(--layout-max);
  margin-inline: auto;
  padding: 1.75rem var(--layout-gutter) 1.25rem;
}

.site-footer__identity {
  min-width: 0;
}

.brand--footer .brand__mark {
  width: 1.8rem;
  height: 1.8rem;
}

.brand--footer .brand__name {
  font-size: 0.95rem;
}

.brand--footer .brand__tagline {
  font-size: 0.625rem;
}

.site-footer__note {
  max-width: 34ch;
  margin-top: 0.55rem;
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.35rem 1.1rem;
}

.site-footer__link {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 0.22em;
  transition: color var(--duration-fast) var(--ease-soft), text-decoration-color var(--duration-fast) var(--ease-soft);
}

.site-footer__link:hover {
  color: var(--brand);
  text-decoration-color: currentColor;
}

.site-footer__meta {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.site-footer__meta-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: 1.5;
}

.site-footer__meta-item time {
  color: var(--text-secondary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.site-footer__baseline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  width: 100%;
  max-width: var(--layout-max);
  margin-inline: auto;
  padding: 0.8rem var(--layout-gutter) 1.1rem;
  border-top: 1px solid var(--border);
}

.site-footer__copyright,
.site-footer__version {
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: 1.5;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
  }
}
