:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  background: #0b1220;
  color: #e6edf7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

main {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0;
}

header,
.history-heading,
.card-heading,
dl div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 6vw, 4rem);
}

.eyebrow {
  color: #70d6ff;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

#updated,
.reading-time,
dt {
  color: #91a0b8;
}

.status {
  margin: 2rem 0;
  color: #ffca6a;
}

.history {
  margin: 3rem 0;
}

.history-heading {
  align-items: flex-end;
}

.history-heading h2 {
  margin-top: .35rem;
  font-size: 1.75rem;
}

.history-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .75rem;
}

.button-group {
  display: flex;
  align-items: stretch;
  border: 1px solid #30405d;
  border-radius: .6rem;
  overflow: hidden;
  background: #111c30;
}

button {
  min-height: 2.4rem;
  border: 0;
  padding: 0 .8rem;
  background: transparent;
  color: #b8c4d8;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
}

.button-group > button {
  border-right: 1px solid #30405d;
}

.button-group > button:last-child {
  border-right: 0;
}

button:hover:not(:disabled),
button[aria-pressed="true"] {
  background: #203552;
  color: #fff;
}

button:focus-visible,
input:focus-visible,
.card:focus-visible {
  outline: 2px solid #70d6ff;
  outline-offset: -2px;
}

button:disabled {
  color: #526077;
  cursor: not-allowed;
}

.time-picker {
  position: relative;
}

#picker-toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 13rem;
  justify-content: center;
}

#picker-toggle .caret {
  color: #91a0b8;
  font-size: .8rem;
}

#range-label {
  color: #d7dfec;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}

.picker-panel {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15rem;
  width: min(36rem, calc(100vw - 2rem));
  border: 1px solid #30405d;
  border-radius: .8rem;
  background: #0f1a2d;
  box-shadow: 0 18px 50px rgb(0 0 0 / 45%);
}

.picker-panel[hidden] {
  display: none;
}

.picker-absolute {
  display: grid;
  align-content: start;
  gap: .4rem;
  padding: 1rem;
  border-right: 1px solid #24324a;
}

.picker-absolute h3 {
  margin-bottom: .35rem;
  font-size: .95rem;
}

.picker-absolute label {
  margin-top: .35rem;
  color: #91a0b8;
  font-size: .8rem;
}

.picker-panel input {
  width: 100%;
  min-height: 2.3rem;
  border: 1px solid #30405d;
  border-radius: .45rem;
  padding: 0 .65rem;
  background: #0b1220;
  color: #e6edf7;
  font: inherit;
  font-size: .9rem;
}

.picker-hint {
  margin-top: .35rem;
  color: #91a0b8;
  font-size: .78rem;
  line-height: 1.5;
}

.picker-hint code {
  color: #d7dfec;
}

.picker-error {
  min-height: 1.1rem;
  color: #ff9b9b;
  font-size: .8rem;
}

button.primary {
  border-radius: .45rem;
  background: #2f6fb3;
  color: #fff;
}

button.primary:hover {
  background: #3b82cf;
}

.picker-timezone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid #24324a;
  color: #91a0b8;
  font-size: .8rem;
}

.picker-timezone button {
  min-height: 2rem;
  font-size: .8rem;
}

.picker-presets {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 26rem;
  padding: .75rem 0 .5rem;
}

.picker-presets input {
  width: calc(100% - 1.5rem);
  margin: 0 .75rem .5rem;
}

.picker-presets ul {
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.picker-presets li button {
  width: 100%;
  min-height: 2rem;
  padding: 0 1rem;
  text-align: left;
  font-size: .88rem;
  font-weight: 500;
}

.picker-presets li button[aria-pressed="true"] {
  box-shadow: inset 3px 0 #70d6ff;
}

.metric-selector {
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  margin-top: 1.25rem;
}

.metric-selector button {
  font-size: .9rem;
}

.chart-status {
  min-height: 1.5rem;
  margin-top: 1rem;
  color: #ffca6a;
}

.chart-panel {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid #24324a;
  border-radius: 1rem;
  background: #111c30;
}

.chart-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.chart-panel h3 {
  font-size: 1.1rem;
}

.chart-panel-heading p {
  margin-top: .2rem;
  color: #91a0b8;
  font-size: .85rem;
}

.focus {
  display: flex;
  flex: none;
  align-items: center;
  gap: .6rem;
  border: 1px solid #2c5a7a;
  border-radius: 999px;
  padding: .2rem .25rem .2rem .85rem;
  background: #11304a;
  color: #b8dcf2;
  font-size: .85rem;
}

.focus[hidden] {
  display: none;
}

.focus strong {
  color: #fff;
}

.focus button {
  min-height: 1.9rem;
  border-radius: 999px;
  padding: 0 .75rem;
  background: #1c4566;
  color: #fff;
  font-size: .8rem;
}

.chart {
  position: relative;
  min-height: 260px;
  margin-top: .75rem;
}

.chart .u-select {
  background: rgb(112 214 255 / 14%);
}

.chart-empty {
  display: grid;
  min-height: 260px;
  place-items: center;
  color: #91a0b8;
}

.chart-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  min-width: 12rem;
  max-width: 20rem;
  padding: .55rem .7rem;
  border: 1px solid #30405d;
  border-radius: .5rem;
  background: rgb(11 18 32 / 94%);
  box-shadow: 0 8px 24px rgb(0 0 0 / 40%);
  font-size: .78rem;
  pointer-events: none;
}

.chart-tooltip p {
  margin-bottom: .35rem;
  color: #91a0b8;
}

.chart-tooltip div {
  display: grid;
  grid-template-columns: .6rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .45rem;
  padding: .1rem 0;
}

.chart-tooltip div span:first-child {
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
}

.chart-tooltip div span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-tooltip strong {
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .5rem;
  margin-top: .5rem;
  padding: .6rem 0 0;
  border-top: 1px solid #24324a;
  font-size: .8rem;
}

.chart-legend button {
  display: grid;
  grid-template-columns: .65rem auto auto;
  align-items: center;
  gap: .4rem;
  min-height: 1.9rem;
  border-radius: .4rem;
  padding: 0 .5rem;
  font-weight: 500;
}

.chart-legend button > span:first-child {
  width: .65rem;
  height: .65rem;
  border-radius: 50%;
}

.chart-legend button.muted {
  opacity: .4;
}

.chart-legend strong {
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.chart-hint {
  margin-top: .6rem;
  color: #6c7b93;
  font-size: .75rem;
}

.section-heading {
  margin-top: 3rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.card {
  padding: 1.25rem;
  border: 1px solid #24324a;
  border-radius: 1rem;
  background: #111c30;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.card:hover {
  border-color: #3a5174;
}

.card.selected {
  border-color: #70d6ff;
  background: #13253d;
}

.card-heading {
  align-items: flex-start;
}

.card-heading span {
  flex: none;
  padding: .3rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
}

.online {
  background: #153f36;
  color: #69e3bc;
}

.offline {
  background: #46262b;
  color: #ff9b9b;
}

dl {
  margin: 1.25rem 0;
}

dl div {
  padding: .5rem 0;
  border-bottom: 1px solid #24324a;
}

dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  header,
  .history-heading,
  .chart-panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-controls,
  .time-picker,
  .time-picker > .button-group {
    width: 100%;
  }

  #picker-toggle {
    flex: 1;
    min-width: 0;
  }

  .picker-panel {
    left: 0;
    right: auto;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .picker-absolute {
    border-right: 0;
    border-bottom: 1px solid #24324a;
  }

  .picker-presets {
    max-height: 16rem;
  }

  .chart-panel {
    padding: 1rem .75rem;
  }
}
