/* /status/ — service status (api/status.py). Colours from tokens.css; the warning colour exists only here. */
:root { --st-warn: #A65F00; --st-warn-soft: #FCF2E3; --st-empty: var(--surface-2); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --st-warn: #E2A33E; --st-warn-soft: #2A2113; --st-empty: var(--surface-2); }
}
:root[data-theme="dark"] { --st-warn: #E2A33E; --st-warn-soft: #2A2113; --st-empty: var(--surface-2); }

.st { position: relative; max-width: calc(760px + 2 * var(--gutter)); padding-block: 56px 0; }
:where(.st) p { margin: 0; }
.st-h1 { font-size: var(--h2); line-height: var(--h2-lh); margin: 0 0 24px; }
.st-h2 { font-size: var(--h3); line-height: var(--h3-lh); margin: 0; }
.st bdi.num { white-space: nowrap; }

/* overall line */
.st-overall { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px;
  margin: 0 0 32px; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); }
.st-overall-text { display: inline-flex; align-items: center; gap: 10px; font-weight: var(--w-medium); }
.st-overall-text::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.st-overall[data-state="loading"] .st-overall-text::before, .st-overall[data-state="error"] .st-overall-text::before { display: none; }
.st-overall[data-state="operational"] { background: var(--accent-soft); border-color: transparent; }
.st-overall[data-state="operational"] .st-overall-text::before { background: var(--accent); }
.st-overall[data-state="degraded"] { background: var(--st-warn-soft); border-color: transparent; }
.st-overall[data-state="degraded"] .st-overall-text::before { background: var(--st-warn); }
.st-overall[data-state="down"] { background: var(--danger-soft); border-color: transparent; }
.st-overall[data-state="down"] .st-overall-text::before { background: var(--danger); }
.st-overall-meta { color: var(--muted); font-size: var(--small); line-height: var(--small-lh); font-variant-numeric: tabular-nums; }

/* components */
.st-card { border: 1px solid var(--border); border-radius: var(--r-card); }
.st-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px;
  padding: 14px 20px; border-bottom: 1px solid var(--border); }
.st-window { color: var(--muted); font-size: var(--small); line-height: var(--small-lh); }
.st-list { list-style: none; margin: 0; padding: 0; }
.st-row { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.st-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.st-name { margin: 0; font-size: var(--body); line-height: var(--body-lh); font-weight: var(--w-medium); min-width: 0; overflow-wrap: anywhere; }
.st-now { display: inline-flex; align-items: center; gap: 6px; flex: none; color: var(--muted); font-size: var(--small); line-height: var(--small-lh); }
.st-now::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.st-now[data-ok="1"] { color: var(--accent); }
.st-now[data-ok="1"]::before { background: var(--accent); }
.st-now[data-ok="0"] { color: var(--danger); }
.st-now[data-ok="0"]::before { background: var(--danger); }
.st-what { margin: 2px 0 12px; color: var(--muted); font-size: var(--small); line-height: var(--small-lh); max-width: 600px; }

.st-bar { display: flex; gap: 2px; height: 28px; }
.st-bar i { flex: 1 1 0; min-width: 0; border-radius: 2px; background: var(--st-empty); cursor: default; }
.st-bar i.is-up { background: var(--accent); }
.st-bar i.is-part { background: var(--st-warn); }
.st-bar i.is-low { background: var(--danger); }
.st-bar i.is-pre { background: none; box-shadow: inset 0 -2px 0 var(--border); }
/* measured for only part of the hour (a gap): paler, the tooltip gives the count */
.st-bar i.is-thin { opacity: .5; }
.st-bar i:hover, .st-bar i.is-on { opacity: .65; }

.st-figs { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 10px; color: var(--muted);
  font-size: var(--small); line-height: var(--small-lh); font-variant-numeric: tabular-nums; }
.st-figs .st-up { color: var(--text); font-weight: var(--w-medium); }
.st-figs .st-late { color: var(--st-warn); }

.st-axis { display: flex; justify-content: space-between; padding: 10px 20px 14px; color: var(--muted); font-size: var(--caption); line-height: var(--caption-lh); }

/* the one tooltip of the page */
.st-tip { position: absolute; z-index: 5; transform: translate(-50%, calc(-100% - 8px)); padding: 6px 10px; border-radius: var(--r-control);
  width: max-content; max-width: calc(100vw - 2 * var(--gutter));
  background: var(--text); color: var(--bg); font-size: var(--caption); line-height: var(--caption-lh); white-space: nowrap;
  font-variant-numeric: tabular-nums; pointer-events: none; text-align: start; }

/* sections */
.st-sec { margin-top: 48px; }
.st-sub { margin-top: 2px; color: var(--muted); font-size: var(--small); line-height: var(--small-lh); }
.st-chart { position: relative; margin-top: 20px; padding-top: 22px; touch-action: pan-y; }
.st-chart svg { display: block; width: 100%; height: 96px; overflow: visible; }
.st-chart-max { position: absolute; top: 0; inset-inline-start: 0; color: var(--muted); font-size: var(--caption); line-height: var(--caption-lh); font-variant-numeric: tabular-nums; }
.st-chart-base { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.st-chart-line { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.st-chart-cursor { stroke: var(--muted); stroke-width: 1; vector-effect: non-scaling-stroke; }
.st-axis-chart { padding: 8px 0 0; }

.st-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0 0; }
.st-stats div { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-card); min-width: 0; }
.st-stats dt { color: var(--muted); font-size: var(--small); line-height: var(--small-lh); }
.st-stats dd { margin: 4px 0 0; font-size: var(--h3); line-height: var(--h3-lh); font-weight: var(--w-medium); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.st-asn { color: var(--muted); font-size: var(--small); font-weight: var(--w-regular); }

.st-incidents { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--border); }
.st-incidents li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.st-incidents .st-inc-name { font-weight: var(--w-medium); flex: 1 1 10rem; }
.st-incidents .st-inc-when, .st-incidents .st-inc-len { color: var(--muted); font-size: var(--small); font-variant-numeric: tabular-nums; }
.st-incidents .st-inc-len[data-ongoing] { color: var(--danger); }
.st-empty { margin-top: 12px; color: var(--muted); }

.st-note { margin-top: 48px; color: var(--muted); font-size: var(--small); line-height: var(--small-lh); max-width: 640px; }

@media (max-width: 560px) {
  .st { padding-top: 32px; }
  .st-overall { padding: 14px 16px; }
  .st-card-head, .st-row { padding-inline: 16px; }
  .st-axis { padding-inline: 16px; }
  .st-axis-chart { padding-inline: 0; }
  .st-bar { gap: 1px; height: 26px; }
  .st-bar i { border-radius: 1px; }
  .st-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-stats div:last-child { grid-column: 1 / -1; }
}
