:root {
  color-scheme: dark;
  --background: #111214;
  --surface: #191a1d;
  --border: #2b2d31;
  --text: #eceef0;
  --secondary: #a2a6ad;
  --muted: #92969e;
  --accent: #a7c5e6;
  --up: #78b899;
  --degraded: #d0ad6b;
  --down: #df8b8b;
  --unknown: #92969e;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 24px; }
body { margin: 0; background: var(--background); color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: wait; color: var(--muted); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: 18px; font-weight: 600; letter-spacing: -.2px; }
h2 { font-size: 16px; font-weight: 600; letter-spacing: -.2px; }
.shell { width: min(880px, calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: fixed; top: -64px; left: 16px; z-index: 10; background: var(--text); color: var(--background); padding: 10px 16px; }
.skip-link:focus { top: 12px; color: var(--background); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.page-brand { display: block; width: fit-content; margin: 40px auto 28px; }
.page-brand img { display: block; width: 112px; height: 38px; object-fit: contain; }
.services-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.services-meta time { font-variant-numeric: tabular-nums; }
.services-meta #refresh { margin-left: auto; }
#feed-notice { color: var(--degraded); }
#refresh { padding: 2px 0; border: 0; border-bottom: 1px solid transparent; background: none; color: var(--secondary); font-size: 13px; }
#refresh:hover:not(:disabled) { color: var(--text); border-bottom-color: var(--muted); }
[data-state="up"] { --state: var(--up); }
[data-state="degraded"] { --state: var(--degraded); }
[data-state="down"] { --state: var(--down); }
[data-state="unknown"] { --state: var(--unknown); }

.section-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 16px; }
.section-heading > p { color: var(--muted); font-size: 13px; }
.period-selector { display: flex; border: 1px solid var(--border); border-radius: 5px; padding: 2px; gap: 2px; }
.period-selector button { border: 0; background: transparent; color: var(--secondary); padding: 6px 11px; border-radius: 3px; font-size: 13px; min-height: 32px; }
.period-selector button:hover { background: var(--surface); color: var(--text); }
.period-selector button[aria-pressed="true"] { color: var(--text); background: #2a2c30; }
#service-list { border: 1px solid var(--border); border-radius: 6px; }
.service { padding: 20px 24px 16px; }
.service + .service { border-top: 1px solid var(--border); }
.service-header { display: grid; grid-template-columns: 1fr 216px 172px; align-items: center; gap: 20px; }
.service-identity { min-width: 0; }
.service-name { font-size: 15px; font-weight: 600; }
.service-status { display: flex; align-items: center; justify-content: flex-end; gap: 7px; color: var(--state); font-size: 13px; grid-column: 3; grid-row: 1; }
.service-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 6px; }
.service-metrics { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; grid-column: 2; grid-row: 1; }
.service-metrics dt { color: var(--muted); font-size: 12px; white-space: nowrap; }
.service-metrics dd { font-size: 14px; font-variant-numeric: tabular-nums; margin-top: 3px; }
.unit { color: var(--secondary); font-size: 12px; margin-left: 3px; }
.history-inspector { position: relative; margin-top: 12px; min-width: 0; }
.history { height: 38px; display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); align-items: center; gap: 4px; }
.history.days-90 { grid-template-columns: repeat(90, minmax(0, 1fr)); gap: 3px; }
.day { display: block; height: 20px; min-width: 0; border-radius: 1px; background: #35383e; }
.day[data-state="up"] { background: #568d72; }
.day[data-state="degraded"] { background: #ac8c50; }
.day[data-state="down"] { background: #b86b6b; }
.partial { background-image: repeating-linear-gradient(135deg, transparent 0 2px, #111214bb 2px 4px) !important; }
.inspector-control { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: crosshair; }
.history-inspector:has(input:focus-visible), .plot-inspector:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.history-tooltip { position: absolute; bottom: calc(100% + 4px); left: 0; z-index: 2; width: max-content; max-width: 100%; border: 1px solid #42454b; border-radius: 4px; padding: 9px 12px; background: #24262a; color: var(--text); font-size: 12px; line-height: 1.6; box-shadow: 0 3px 8px #0003; }
.history-caption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 12px; }
.data-notes { margin-top: 12px; color: var(--muted); font-size: 12px; }
.data-notes summary { width: fit-content; cursor: pointer; }
.data-notes summary:hover { color: var(--text); }
.data-notes[open] { padding-bottom: 4px; }
.history-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; color: var(--secondary); font-size: 12px; }
.history-legend > span { display: flex; align-items: center; gap: 6px; }
.history-legend i { width: 7px; height: 10px; border-radius: 1px; background: var(--state, #757980); }
.history-legend i[data-state="unknown"] { background: #555960; }
.method-note { margin-top: 8px; color: var(--muted); font-size: 12px; }
.host-metrics { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 12px; font-size: 13px; color: var(--secondary); }
.host-metrics div { display: flex; gap: 7px; }
.host-metrics dd { color: var(--text); font-variant-numeric: tabular-nums; }

.response-section, #incidents { margin-top: 36px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 16px; color: var(--secondary); font-size: 12px; margin-bottom: 16px; }
.chart-legend span { display: flex; align-items: center; gap: 7px; }
.chart-legend i { width: 14px; height: 2px; background: var(--accent); }
.chart-legend span:nth-child(2) i { background: #92969e; }
.response-plot { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 0 12px; }
.chart-y-axis { height: 140px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-y-axis span { line-height: 1; }
.plot-inspector { position: relative; height: 140px; }
.plot-inspector svg { width: 100%; height: 100%; overflow: visible; fill: none; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.series-0 { stroke: var(--accent); stroke-width: 1.5; }
.series-1 { stroke: #92969e; stroke-width: 1.5; }
.point-0 { fill: var(--accent); }
.point-1 { fill: #92969e; }
.chart-cursor { stroke: #71757d; stroke-dasharray: 3 4; stroke-width: 1; }
.chart-x-axis { grid-column: 2; display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-details { grid-column: 2; margin-top: 12px; color: var(--secondary); font-size: 12px; font-variant-numeric: tabular-nums; min-height: 36px; }
.empty-state { color: var(--secondary); padding: 20px 24px; }

#incident-list { border-top: 1px solid var(--border); }
#incident-list .empty-state { padding: 20px 0; }
.incident-row { display: grid; grid-template-columns: 140px 1fr; column-gap: 24px; padding-block: 20px; border-bottom: 1px solid var(--border); }
.incident-date { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.incident-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; }
.incident-heading h3 { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.incident-state { font-size: 12px; color: var(--degraded); white-space: nowrap; }
.incident-state.resolved { color: var(--secondary); }
.incident-details { color: var(--secondary); font-size: 13px; margin-top: 7px; }
.incident-details time { font-variant-numeric: tabular-nums; }
.notice { margin-top: 24px; color: var(--secondary); }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; border-top: 1px solid var(--border); padding-block: 20px 28px; margin-top: 36px; color: var(--muted); font-size: 12px; }
.site-footer a { color: var(--secondary); }
.site-footer a > span { color: var(--muted); margin-left: 4px; }
.site-footer nav { display: flex; gap: 16px; }
.not-found { padding-block: 64px; }
.not-found h1 { font-size: 28px; font-weight: 600; margin-bottom: 12px; }
.not-found a { color: var(--accent); }

@media (max-width: 760px) {
  .shell { width: calc(100% - 40px); }
  .service-header { grid-template-columns: 1fr auto; gap: 14px 12px; }
  .service-status { grid-column: 2; }
  .service-metrics { grid-column: 1 / -1; grid-row: 2; grid-template-columns: auto auto; justify-content: start; gap: 32px; }
  .service-metrics > div { display: flex; align-items: baseline; gap: 8px; }
  .service-metrics dd { margin: 0; }
  .service { padding: 18px 20px 16px; }
  .history.days-90 { gap: 2px; }
  .history { gap: 3px; height: 44px; }
}

@media (max-width: 540px) {
  .shell { width: calc(100% - 32px); }
  .page-brand { margin-block: 32px 24px; }
  #refresh { min-height: 32px; }
  .period-selector button { font-size: 12px; padding-inline: 9px; min-height: 36px; }
  .service { padding: 16px 14px 14px; }
  .service-status { max-width: 120px; font-size: 12px; text-align: right; }
  .service-metrics { gap: 24px; }
  .service-metrics > div { display: block; }
  .service-metrics dd { margin-top: 3px; }
  .service-metrics dt { font-size: 12px; }
  .day { height: 22px; }
  .history.days-90 { gap: 1px; }
  .history-caption, .history-tooltip { font-size: 12px; }
  .history-legend { gap: 8px 12px; }
  .method-note { max-width: 300px; }
  .response-section, #incidents { margin-top: 28px; }
  .response-plot { grid-template-columns: 42px minmax(0, 1fr); gap: 0 8px; }
  .chart-x-axis span:nth-child(2) { display: none; }
  .chart-details { min-height: 54px; }
  .incident-row { grid-template-columns: 1fr; gap: 8px; padding-block: 18px; }
  .incident-date { font-size: 12px; }
  .site-footer { margin-top: 28px; padding-block: 18px 24px; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
