/* OpenFirehouse status page — the app's own palette: red-700 header, gray cards, system font.
   Three states only: up (green), not responding (red), unknown (grey). No amber (ruling #10). */
:root {
  --page: #f9fafb; --card: #ffffff; --line: #e5e7eb; --fg: #111827; --muted: #4b5563; --faint: #6b7280;
  --brand: #b91c1c; --brand-ink: #ffffff; --brand-chip: rgba(255,255,255,.16);
  --up: #15803d; --up-soft: #dcfce7; --down: #b91c1c; --down-soft: #fee2e2; --none: #d1d5db;
  --unk: #4b5563; --unk-soft: #f3f4f6; --focus: #2563eb;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #030712; --card: #111827; --line: #374151; --fg: #f3f4f6; --muted: #d1d5db; --faint: #9ca3af;
    --up: #4ade80; --up-soft: rgba(34,197,94,.16); --down: #f87171; --down-soft: rgba(239,68,68,.16); --none: #374151;
    --unk: #d1d5db; --unk-soft: rgba(156,163,175,.16); --focus: #60a5fa;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* .card / .pop set display, which would otherwise beat the attribute */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--fg); font: 15px/1.5 var(--sans); }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
a { color: inherit; }

.sp-head { background: var(--brand); color: var(--brand-ink); display: flex; align-items: center; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 20px 12px; }
.logo { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-chip); display: grid; place-items: center; flex: none; }
.sp-head .t { display: grid; line-height: 1.15; min-width: 0; }
.sp-head .t small { font-size: 11px; letter-spacing: .1em; font-weight: 700; opacity: .9; }
.sp-head h1 { font-size: 18px; }

.sp-body { padding: 20px 16px; display: grid; gap: 16px; max-width: 780px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: grid; gap: 14px; min-width: 0; }
.h3 { font-size: 16px; }

.now { display: flex; gap: 14px; align-items: flex-start; }
.dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--none); }
.now[data-s="up"] .dot { background: var(--up); box-shadow: 0 0 0 5px var(--up-soft); }
.now[data-s="down"] .dot { background: var(--down); box-shadow: 0 0 0 5px var(--down-soft); }
.now[data-s="unknown"] .dot { background: var(--unk); box-shadow: 0 0 0 5px var(--unk-soft); }
.now h2 { font-size: 22px; line-height: 1.25; }
.now p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.now .act { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--down-soft); color: var(--fg); }

.lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.lines li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lines li:last-child { border-bottom: 0; padding-bottom: 0; }
.chip { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.chip.up { background: var(--up-soft); color: var(--up); }
.chip.down { background: var(--down-soft); color: var(--down); }
.chip.unknown { background: var(--unk-soft); color: var(--unk); }

.row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.tools { display: flex; gap: 8px; align-items: center; }
.info, .listbtn { font: 600 13px var(--sans); border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; min-height: 32px; }
.info { width: 32px; border-radius: 50%; }
.listbtn { border-radius: 8px; padding: 4px 12px; }
.pop { font-size: 13px; color: var(--muted); background: var(--page); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 6px; }
.pop p { margin: 0; max-width: 66ch; }

.check { display: grid; gap: 8px; min-width: 0; }
.check + .check { border-top: 1px solid var(--line); padding-top: 14px; }
.check-h { display: grid; gap: 2px; } /* the same shape for every check, however long its name */
.check-h h3 { font-size: 15px; }
.figs { display: flex; flex-wrap: wrap; gap: 4px 16px; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); margin: 0; }
.figs b { color: var(--fg); font-size: 14px; }
/* All 90 days always fit the card — today must never scroll out of sight on a phone. */
.bars { display: grid; grid-template-columns: repeat(90, 1fr); gap: 1px; height: 30px; }
@media (min-width: 520px) { .bars { gap: 2px; } }
.bars span { border-radius: 2px; background: var(--none); }
.bars span.up { background: var(--up); }
.bars span.down { background: var(--down); }
.bars span:hover { opacity: .7; }
.axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--faint); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.k-up { background: var(--up); } .k-down { background: var(--down); } .k-none { background: var(--none); }
.tip { font-size: 13px; color: var(--muted); min-height: 20px; margin: 0; font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow: auto; max-height: 300px; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { position: sticky; top: 0; background: var(--card); color: var(--muted); font-weight: 600; }

.maint-item { display: grid; gap: 2px; }
.maint-item + .maint-item { border-top: 1px solid var(--line); padding-top: 10px; }
.maint-item b { font-variant-numeric: tabular-nums; }

.inc { display: grid; gap: 14px; }
.inc article { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.inc article:first-child { border-top: 0; padding-top: 0; }
.inc h3 { font-size: 15px; }
.meta { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; margin: 0; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 9px; margin-left: 6px; vertical-align: 1px; }
.pill.ok { background: var(--up-soft); color: var(--up); }
.pill.bad { background: var(--down-soft); color: var(--down); }
.upd { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; margin: 0; }
.upd dt { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.upd dd { margin: 0; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.quiet { font-size: 14px; color: var(--faint); margin: 0; }
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; }
.hist a { text-underline-offset: 3px; }

.sp-foot { border-top: 1px solid var(--line); padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); font-size: 13px; color: var(--faint);
  display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; }
.sp-foot a { text-underline-offset: 3px; }
.sel { user-select: all; }
@media (max-width: 520px) { .sp-head { padding-left: 16px; padding-right: 16px; } .card { padding: 16px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
