:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #172033;
  background: #f4f7fb;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-width: 0; }
body { margin: 0; overflow-x: hidden; }
button, a { font: inherit; }

.status-shell {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.page-header h1 { margin: 2px 0 6px; font-size: 28px; }
.section-label, .muted { margin: 0; color: #66758d; }
.section-label { font-size: 13px; font-weight: 700; }
.header-actions { display: flex; gap: 10px; }
button, .secondary-button {
  min-height: 42px;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: #1463df;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}
button:disabled { cursor: wait; opacity: .55; }
.secondary-button { background: #e8eef7; color: #23324d; }

.message, .status-band, .section-block {
  border: 1px solid #dfe6f0;
  border-radius: 8px;
  background: #fff;
}
.message { display: grid; gap: 5px; padding: 16px; }
.error-message { border-color: #f0b8b8; background: #fff8f8; color: #8d2020; }
.status-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-left: 5px solid #d18a13;
}
.status-band > div { display: flex; align-items: center; gap: 10px; }
.status-band p { margin: 0; color: #66758d; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #d18a13; }
.status-band[data-state="healthy"] { border-left-color: #14866d; }
.status-band[data-state="healthy"] .status-dot { background: #14866d; }
.status-band[data-state="blind"], .status-band[data-state="stalled"], .status-band[data-state="stale"] {
  border-color: #e6aaaa;
  border-left-color: #c83b3b;
  background: #fff7f7;
}
.status-band[data-state="blind"] .status-dot,
.status-band[data-state="stalled"] .status-dot,
.status-band[data-state="stale"] .status-dot { background: #c83b3b; }
.status-band[data-state="stale"] strong,
.status-band[data-state="stale"] p { color: #8d2020; }
#status-content.is-stale .metric-grid,
#status-content.is-stale .section-block { opacity: .58; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.metric-block {
  min-width: 0;
  padding: 18px;
  border: 1px solid #dfe6f0;
  border-radius: 8px;
  background: #fff;
}
.metric-block > span { display: block; color: #66758d; }
.metric-block > strong { display: block; margin: 10px 0 8px; overflow-wrap: anywhere; font-size: 23px; }
.metric-block small { display: block; margin-top: 5px; color: #66758d; }
.metric-block b { color: #23324d; }

.section-block { margin-top: 16px; overflow: hidden; }
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #e6ebf2;
}
.section-heading h2 { margin: 0; font-size: 18px; }
.section-heading span { color: #77869b; font-size: 13px; }
.status-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.status-rows > div, .storage-grid > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 15px 18px;
  border-bottom: 1px solid #edf1f6;
}
.status-rows > div:nth-last-child(-n+2) { border-bottom: 0; }
.status-rows span, .storage-grid span { color: #66758d; }
.status-rows strong, .storage-grid strong { overflow-wrap: anywhere; text-align: right; }
.storage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.storage-grid > div { display: grid; gap: 7px; border-bottom: 0; }
.storage-grid strong { text-align: left; font-size: 20px; }
.event-row { display: flex; justify-content: space-between; gap: 14px; padding: 18px; }
.event-row time { color: #66758d; }

@media (max-width: 900px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .status-shell { padding: 14px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .header-actions { width: 100%; }
  .header-actions > * { flex: 1; text-align: center; }
  .status-band { align-items: flex-start; flex-direction: column; }
  .metric-grid, .status-rows, .storage-grid { grid-template-columns: 1fr; }
  .status-rows > div { border-bottom: 1px solid #edf1f6; }
  .status-rows > div:last-child { border-bottom: 0; }
  .event-row { align-items: flex-start; flex-direction: column; }
}
