/* Ledgerlight status: calm, data-forward, light only. */
:root {
  color-scheme: light;
  --rst-bg: #f5f7f6;
  --rst-surface: #ffffff;
  --rst-surface-2: #eef2f1;
  --rst-text: #15243a;
  --rst-text-muted: #4b5a6b;
  --rst-line: #dde3e2;
  --rst-line-strong: #87949f;
  --rst-accent: #0f5f63;
  --rst-accent-soft: #e2efee;
  --rst-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rst-radius: 10px;
  --rst-radius-sm: 6px;
  --rst-depth-ambient: rgba(21, 36, 58, 0.04);
  --rst-depth-contact: rgba(21, 36, 58, 0.06);

  --ok-fg: #1c6a3b;   --ok-bg: #e3f2e8;   --ok-dot: #2b8a50;
  --slow-fg: #774700; --slow-bg: #fbf0d6; --slow-dot: #c98a12;
  --part-fg: #973210; --part-bg: #fde8dc; --part-dot: #dd6a2c;
  --major-fg: #9e1b2a; --major-bg: #fbe3e5; --major-dot: #cf3346;
}

html, body { background: var(--rst-bg); color: var(--rst-text); }
body { margin: 0; font-family: var(--rst-font); line-height: 1.5; }
time, .chip, .incident-when { font-variant-numeric: tabular-nums; }

.wrap { box-sizing: border-box; width: 100%; max-width: 50rem; margin-inline: auto; padding-inline: 1rem; }

/* Header band */
.masthead { background: var(--rst-surface); border-bottom: 1px solid var(--rst-line); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.75rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--rst-text); text-decoration: none; min-height: 44px; }
.brand-name { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
.brand-sub { color: var(--rst-text-muted); font-size: 1.1rem; padding-left: 0.55rem; border-left: 1px solid var(--rst-line); }
.json-link { color: var(--rst-accent); font-size: 0.9rem; display: inline-flex; align-items: center; min-height: 44px; }

main.rst-page { padding-top: 1.5rem; padding-bottom: 1rem; }
section { margin-bottom: 2rem; }
.section-title { font-size: 0.8rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rst-text-muted); margin: 0 0 0.6rem; }
.muted { color: var(--rst-text-muted); }

/* Flash messages */
.flash { padding: 0.7rem 0.9rem; border-radius: var(--rst-radius-sm); margin: 0 0 1rem; font-weight: 550; }
.flash-ok { background: var(--ok-bg); color: var(--ok-fg); }
.flash-error { background: var(--major-bg); color: var(--major-fg); }

/* Overall summary */
.summary { display: flex; align-items: center; gap: 0.9rem; padding: 1.1rem 1.2rem; border-radius: var(--rst-radius); border: 1px solid var(--rst-line); background: var(--ok-bg); color: var(--ok-fg); }
.summary h1 { font-size: 1.35rem; line-height: 1.3; margin: 0; color: var(--rst-text); }
.summary p { margin: 0.15rem 0 0; font-size: 0.9rem; }
.summary-icon { flex: none; display: flex; }
.summary[data-state="degraded"] { background: var(--slow-bg); color: var(--slow-dot); }
.summary[data-state="partial"] { background: var(--part-bg); color: var(--part-dot); }
.summary[data-state="major"] { background: var(--major-bg); color: var(--major-dot); }
.summary[data-state="operational"] { color: var(--ok-dot); }

/* Component list */
.parts { list-style: none; margin: 0; padding: 0; background: var(--rst-surface); border: 1px solid var(--rst-line); border-radius: var(--rst-radius); }
.part { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 1.1rem; min-height: 2.75rem; box-sizing: border-box; }
.part + .part { border-top: 1px solid var(--rst-line); }
.part-name { font-weight: 600; }

/* Status chip: always a dot plus a word */
.chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; white-space: nowrap; background: var(--ok-bg); color: var(--ok-fg); }
.chip .dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--ok-dot); }
.chip[data-state="degraded"] { background: var(--slow-bg); color: var(--slow-fg); }
.chip[data-state="degraded"] .dot { background: var(--slow-dot); }
.chip[data-state="partial"] { background: var(--part-bg); color: var(--part-fg); }
.chip[data-state="partial"] .dot { background: var(--part-dot); }
.chip[data-state="major"] { background: var(--major-bg); color: var(--major-fg); }
.chip[data-state="major"] .dot { background: var(--major-dot); }

.tag { display: inline-block; padding: 0.15rem 0.55rem; border-radius: var(--rst-radius-sm); background: var(--rst-surface-2); color: var(--rst-text-muted); font-size: 0.85rem; font-weight: 550; white-space: nowrap; }

/* Incidents */
.incident { background: var(--rst-surface); border: 1px solid var(--rst-line); border-radius: var(--rst-radius); padding: 1rem 1.1rem 0.4rem; margin-bottom: 0.9rem; }
.incident-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.4rem 1rem; }
.incident-head h3 { font-size: 1.05rem; margin: 0; }
.incident-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.incident-when { margin: 0.3rem 0 0.7rem; font-size: 0.875rem; }
.updates { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rst-line); }
.update { display: grid; grid-template-columns: 11.5rem 1fr; gap: 0.2rem 1rem; padding: 0.7rem 0; }
.update + .update { border-top: 1px dashed var(--rst-line); }
.update-head { display: flex; flex-direction: column; font-size: 0.875rem; }
.update-head time { color: var(--rst-text-muted); }
.update p { margin: 0; overflow-wrap: anywhere; }

/* Staff area */
.staff { border-top: 1px solid var(--rst-line); padding-top: 1.5rem; }
.staff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.staff-box { background: var(--rst-surface); border: 1px solid var(--rst-line); border-radius: var(--rst-radius); padding: 0 1rem; }
.staff-box summary { cursor: pointer; font-weight: 600; min-height: 2.75rem; display: flex; align-items: center; color: var(--rst-accent); }
.staff-box[open] summary { border-bottom: 1px solid var(--rst-line); margin-bottom: 0.25rem; }
.staff-box form { padding-bottom: 1rem; }
.staff-box > p { margin: 0.75rem 0 1rem; }
.hint { display: block; color: var(--rst-text-muted); font-size: 0.8rem; margin-top: 0.3rem; }
.rst-input { min-height: 2.75rem; max-width: 100%; }
textarea.rst-input { resize: vertical; }
[rst-btn] { min-height: 2.75rem; }

.foot { padding-bottom: 2rem; font-size: 0.85rem; }

input:is([type=date], [type=time], [type=datetime-local]) { min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; display: block; min-height: 2.75rem; }

@media (max-width: 40rem) {
  .staff-grid { grid-template-columns: 1fr; }
  .update { grid-template-columns: 1fr; }
  .update-head { flex-direction: row; flex-wrap: wrap; gap: 0 0.5rem; }
  .brand-sub { display: none; }
  .summary h1 { font-size: 1.2rem; }
}

/* Example mode: one-line note at the top of the showcase copy. */
.example-note { display: block; width: 100%; box-sizing: border-box; margin: 0; padding: 0.5rem 1rem; text-align: center; font-family: var(--rst-font, system-ui, sans-serif); font-size: 0.875rem; line-height: 1.4; font-weight: 400; letter-spacing: normal; text-transform: none; background: var(--rst-accent-soft); color: var(--rst-text); }
.example-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
