/* Nereus status page. Phone first; colours only from tokens.css (light and
   dark follow the device). No external fonts. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.5 var(--sans);
}
a { color: var(--brand); text-underline-offset: 2px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) a { color: var(--accent); } }
:root[data-theme="dark"] a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 780px; margin: 0 auto; padding: 0 16px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.skip { position: absolute; left: -9999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

/* ── the problem banner (top, only during a problem) ── */
.alert { border-bottom: 1px solid; padding: 16px 0 18px; }
.alert.is-crit { background: var(--crit-wash); border-color: var(--crit); color: var(--crit-ink); box-shadow: inset 0 4px 0 var(--crit); }
.alert.is-warn { background: var(--warn-wash); border-color: var(--warn); color: var(--warn-ink); box-shadow: inset 0 4px 0 var(--warn); }
.alert-title { font-size: 1.2rem; font-weight: 700; }
.alert-text { margin-top: 4px; color: var(--ink); }
.alert-more { margin-top: 4px; font-size: .9rem; color: var(--ink-2); }
.alert-contact { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.alert-contact-lead { font-weight: 700; width: 100%; color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink) !important; font-weight: 600; text-decoration: none; box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}
.btn:hover { border-color: var(--accent); }

/* ── header ── */
.top { padding: 18px 0 6px; }
.top-inner { display: flex; align-items: center; gap: 10px; }
.logo { display: block; width: 34px; height: auto; }
.brand { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.brand-sub { font-weight: 500; color: var(--muted); }

/* ── overall ── */
.overall {
  display: flex; align-items: center; gap: 14px; margin: 14px 0 0; padding: 16px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
}
.overall-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--line-2); color: var(--muted); }
.overall-text { font-size: 1.25rem; font-weight: 700; }
.checked { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.overall.is-ok { background: var(--ok-wash); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.overall.is-ok .overall-icon { background: var(--ok); color: #fff; }
.overall.is-ok .overall-text { color: var(--ok-ink); }
.overall.is-warn { background: var(--warn-wash); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.overall.is-warn .overall-icon { background: var(--warn); color: #1d1300; }
.overall.is-warn .overall-text { color: var(--warn-ink); }
.overall.is-crit { background: var(--crit-wash); border-color: color-mix(in srgb, var(--crit) 45%, transparent); }
.overall.is-crit .overall-icon { background: var(--crit); color: #fff; }
.overall.is-crit .overall-text { color: var(--crit-ink); }
.overall.is-unknown .overall-icon { background: var(--line); color: var(--ink-2); }
.overall.is-loading .overall-icon { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .overall.is-loading .overall-icon { animation: none; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .overall.is-ok .overall-icon,
  :root:not([data-theme="light"]) .overall.is-crit .overall-icon { color: #08131d; }
}
:root[data-theme="dark"] .overall.is-ok .overall-icon, :root[data-theme="dark"] .overall.is-crit .overall-icon { color: #08131d; }

.notice {
  margin-top: 12px; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--faint);
  background: var(--surface-2); color: var(--ink-2); font-size: .95rem;
}

/* ── sections ── */
.block { margin-top: 28px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.block-head h2 { font-size: 1.05rem; font-weight: 700; }
.block-note { color: var(--muted); font-size: .85rem; }
.hint { color: var(--muted); font-size: .8rem; margin-top: 8px; }

/* ── services ── */
.services { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.svc { padding: 14px 16px 12px; }
.svc + .svc { border-top: 1px solid var(--line-2); }
.svc-empty { color: var(--muted); }
.svc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.svc-head h3 { font-size: 1rem; font-weight: 700; }
.svc-about { color: var(--muted); font-size: .85rem; }
.svc-parts { margin-top: 6px; font-size: .85rem; color: var(--ink-2); }
.pill { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.is-up { background: var(--ok-wash); color: var(--ok-ink); }
.pill.is-slow { background: var(--warn-wash); color: var(--warn-ink); }
.pill.is-down { background: var(--crit-wash); color: var(--crit-ink); }
.pill.is-unknown { background: var(--line-2); color: var(--ink-2); }

.bars { display: flex; gap: 2px; height: 34px; margin-top: 12px; border-radius: 4px; cursor: pointer; touch-action: manipulation; }
.bar { flex: 1 1 0; min-width: 0; border-radius: 2px; background: var(--line); transition: transform .1s; }
.bar.is-ok { background: var(--ok); }
.bar.is-warn { background: var(--warn); }
.bar.is-crit { background: var(--crit); }
.bar:hover, .bar.is-selected { transform: scaleY(1.12); filter: brightness(1.12); }
.bar.is-selected { outline: 2px solid var(--ink); outline-offset: 1px; }
.svc.is-stale .bars { opacity: .55; }
.axis { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: .78rem; color: var(--muted); }
.axis-pct { color: var(--ink-2); font-weight: 600; }
.day-detail { margin-top: 6px; font-size: .88rem; color: var(--ink-2); min-height: 0; }
.day-detail:empty { display: none; }

/* ── incidents ── */
.sub { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; font-weight: 700; }
.sub:first-child { margin-top: 0; }
.empty { color: var(--muted); padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.incident { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--faint); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.incident + .incident { margin-top: 10px; }
.incident.is-major { border-left-color: var(--crit); }
.incident.is-minor { border-left-color: var(--warn); }
.incident.is-resolved { border-left-color: var(--ok); box-shadow: none; }
.incident-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.incident-head h3 { font-size: 1rem; }
.incident-meta { margin-top: 4px; font-size: .85rem; color: var(--muted); }
.chip { flex: none; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.chip.is-investigating { background: var(--crit-wash); color: var(--crit-ink); }
.chip.is-identified { background: var(--warn-wash); color: var(--warn-ink); }
.chip.is-monitoring { background: var(--info-wash); color: var(--info); }
.chip.is-resolved { background: var(--ok-wash); color: var(--ok-ink); }
.updates { list-style: none; margin: 10px 0 0; padding: 0; }
.update { position: relative; padding: 0 0 10px 16px; }
.update::before { content: ""; position: absolute; left: 3px; top: 8px; bottom: -2px; width: 2px; background: var(--line); }
.update::after { content: ""; position: absolute; left: 0; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.update:first-child::after { background: var(--accent); }
.update:last-child { padding-bottom: 0; }
.update:last-child::before { display: none; }
.update-top { font-size: .85rem; color: var(--muted); }
.update-top strong { color: var(--ink); }
.update-msg { margin-top: 2px; overflow-wrap: anywhere; }
.older { margin-top: 12px; }
.older summary { cursor: pointer; color: var(--ink-2); font-weight: 600; padding: 8px 0; min-height: 44px; display: flex; align-items: center; gap: 8px; list-style: none; }
.older summary::-webkit-details-marker { display: none; }
.older summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.older[open] summary::before { transform: rotate(45deg); }
.older[open] summary { margin-bottom: 8px; }

/* ── footer: contact, always there, low-key ── */
.foot { margin-top: 36px; padding: 18px 0 calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--ink-2); font-size: .92rem; }
.foot a { white-space: nowrap; }
.fine { margin-top: 6px; color: var(--muted); font-size: .8rem; }

@media (min-width: 640px) {
  .top { padding-top: 28px; }
  .overall { padding: 18px 20px; }
  .overall-text { font-size: 1.4rem; }
  .svc { padding: 16px 20px 14px; }
  .alert-contact-lead { width: auto; }
  .bars { gap: 2px; }
}
