:root {
  color-scheme: light;
  --bg: #f9f9f7;
  --surface: #fcfcfb;
  --text: #0b0b0b;
  --muted: #52514e;
  --faint: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.1);
  --error: #b42318;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --neutral: #898781;
  --seq-lo: #cde2fb;
  --seq-hi: #0d366b;
  --warning: #fab219;
  --critical: #d03b3b;
  --info: #52514e;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0d0d0d;
    --surface: #1a1a19;
    --text: #f0efec;
    --muted: #c3c2b7;
    --faint: #898781;
    --grid: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255, 255, 255, 0.1);
    --error: #f97066;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --neutral: #898781;
    --seq-lo: #0d366b;
    --seq-hi: #b7d3f6;
    --info: #c3c2b7;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0 auto;
  max-width: 72rem;
  padding: 1rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

h1 {
  font-size: 1.4rem;
  margin: 0;
}

h2 {
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
}

p {
  margin: 0 0 0.5rem;
}

.studio-name,
.muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

.studio-picker {
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
}

select,
button {
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.2rem 0.5rem;
}

.view {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1rem;
  min-width: 0;
}

.view-body {
  min-width: 0;
  transition: opacity 0.15s;
}

.view-body.loading {
  opacity: 0.5;
}

.error {
  color: var(--error);
}

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  margin: 0.25rem 0 0.25rem;
}

.hero-value {
  font-size: 3.5rem;
  font-weight: 600;
  line-height: 1;
}

.hero-term {
  font-size: 1.15rem;
  color: var(--muted);
}

.usual {
  margin-top: 0.5rem;
}

.now-hero {
  margin-bottom: 1rem;
}

.status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
}

.status-icon {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--status);
  color: #0b0b0b;
}

.status-warning {
  --status: var(--warning);
}

.status-critical {
  --status: var(--critical);
}

.status-critical .status-icon {
  color: #fff;
}

.status-info {
  --status: var(--grid);
}

.status-info .status-icon {
  color: var(--text);
}

.chart {
  margin: 0 0 0.75rem;
  min-width: 0;
}

.chart figcaption {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.chart svg,
.chart figure {
  --plot-background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  overflow: visible;
}

.chart figure {
  margin: 0;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.key {
  display: inline-block;
  width: 1rem;
  height: 0.75rem;
  position: relative;
}

.key-line::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 1px);
  height: 2px;
  border-radius: 1px;
  background: var(--key);
}

.key-wash {
  background: color-mix(in srgb, var(--key) 20%, transparent);
  border-radius: 2px;
}

.key-dot::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  left: calc(50% - 4px);
  top: calc(50% - 4px);
  border-radius: 50%;
  background: var(--key);
}

.key-triangle::after {
  content: "";
  position: absolute;
  left: calc(50% - 5px);
  top: calc(50% - 4px);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid var(--key);
}

.range {
  display: inline-flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.range button {
  cursor: pointer;
}

.range button:hover {
  background: color-mix(in srgb, var(--text) 5%, var(--surface));
}

.range button[aria-pressed="true"] {
  font-weight: 600;
  border-color: var(--text);
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.pair > *,
.stack > * {
  min-width: 0;
}

.table-view {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.table-view summary {
  cursor: pointer;
  color: var(--muted);
}

.table-scroll {
  overflow-x: auto;
  margin-top: 0.5rem;
}

table {
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  text-align: left;
  padding: 0.2rem 0.6rem 0.2rem 0;
  border-bottom: 1px solid var(--grid);
  white-space: nowrap;
}

.site-footer {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 2rem 0 1rem;
}

a {
  color: inherit;
}

@media (max-width: 480px) {
  body {
    padding: 0.5rem;
  }

  .view {
    padding: 0.75rem;
    border-radius: 0.5rem;
  }

  .hero-value {
    font-size: 3rem;
  }
}
