/*
 * The status page's look, after the app's approved one (docs/simplify/design-dna.md):
 * a muted near-white canvas, white cards with a hairline border, soft pill chips
 * whose word says the state (color only repeats it), and the X18 green kept to
 * one small mark. Light and dark follow the visitor's setting.
 */

:root {
  --canvas: #f7f7f8;
  --card: #ffffff;
  --text: #18181b;
  --muted: #52525b;
  --border: #e4e4e7;
  --brand: #174f46;
  --focus: #18181b;

  --ok-bg: rgba(16, 185, 129, 0.15);
  --ok-text: #065f46;
  --ok-dot: #10b981;
  --warn-bg: rgba(245, 158, 11, 0.15);
  --warn-text: #92400e;
  --warn-dot: #f59e0b;
  --bad-bg: rgba(239, 68, 68, 0.15);
  --bad-text: #991b1b;
  --bad-dot: #ef4444;
  --fact-bg: #f4f4f5;
  --fact-text: #52525b;
  --fact-dot: rgba(113, 113, 122, 0.5);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0f1514;
    --card: #182120;
    --text: #f6f8f8;
    --muted: #a7b0af;
    --border: rgba(255, 255, 255, 0.1);
    --brand: #34d399;
    --focus: #f6f8f8;

    --ok-bg: rgba(52, 211, 153, 0.1);
    --ok-text: #6ee7b7;
    --warn-bg: rgba(251, 191, 36, 0.1);
    --warn-text: #fcd34d;
    --bad-bg: rgba(248, 113, 113, 0.1);
    --bad-text: #fca5a5;
    --fact-bg: #232d2c;
    --fact-text: #a7b0af;
    --fact-dot: rgba(167, 176, 175, 0.5);
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 16px 48px;
}

.masthead {
  margin-bottom: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--brand);
}

h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 20px;
  margin-bottom: 16px;
}

.summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.summary p {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.summary-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--fact-dot);
}

.summary[data-state="operational"] .summary-dot {
  background: var(--ok-dot);
}

.summary[data-state="degraded"] .summary-dot {
  background: var(--warn-dot);
}

.summary[data-state="down"] .summary-dot {
  background: var(--bad-dot);
}

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

.part {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

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

.part-name {
  font-size: 15px;
}

.state {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: var(--fact-bg);
  color: var(--fact-text);
}

.state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--fact-dot);
}

.state[data-state="operational"] {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.state[data-state="operational"]::before {
  background: var(--ok-dot);
}

.state[data-state="degraded"] {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.state[data-state="degraded"]::before {
  background: var(--warn-dot);
}

.state[data-state="down"] {
  background: var(--bad-bg);
  color: var(--bad-text);
}

.state[data-state="down"]::before {
  background: var(--bad-dot);
}

.checked,
.note,
.footer p {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.checked time {
  font-variant-numeric: tabular-nums;
}

.legend dl {
  margin: 0;
}

.legend div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 6px 0;
}

.legend dt {
  min-width: 96px;
  font-size: 14px;
  font-weight: 600;
}

.legend dd {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.footer {
  padding: 0 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

@media (max-width: 420px) {
  .page {
    padding-top: 28px;
  }

  h1 {
    font-size: 24px;
  }
}
