* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #fafafa;
  color: #222;
}
.app-header {
  padding: 16px 24px 0;
  border-bottom: 1px solid #ddd;
  background: #fff;
}
.app-header h1 {
  font-size: 22px;
  margin: 0 0 4px;
}
.app-header p {
  font-size: 12px;
  color: #666;
  white-space: pre-line;
  margin: 0 0 12px;
}
.tabs {
  display: flex;
  gap: 4px;
}
.tab {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  border-radius: 6px 6px 0 0;
}
.tab:hover { background: #f0f0f0; }
.tab.active {
  background: #fafafa;
  border-color: #ddd;
  position: relative;
  top: 1px;
}
main { padding: 16px 24px; }
.view { display: none; }
.view.active { display: block; }
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
}
.controls label { display: inline-flex; align-items: center; gap: 6px; }
.controls select, .controls input, .controls button {
  font-size: 13px;
  padding: 4px 6px;
}
#single-date-range-wrap {
  align-items: center;
  gap: 12px;
}
#single-date-range-wrap .date-range-field {
  align-items: center;
  margin: 0;
}
#single-date-range-wrap input {
  min-width: 11rem;
}
.chart {
  width: 100%;
  height: 80vh;
  min-height: 600px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}
#chart-single { height: auto; min-height: 800px; }

/* Changelog view */
.changelog {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 16px 24px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow: auto;
  max-height: calc(100vh - 200px);
  margin: 0;
}

footer#footnotes {
  padding: 16px 24px;
  font-size: 11px;
  color: #555;
  border-top: 1px solid #ddd;
  background: #fff;
  white-space: pre-line;
}

/* Table view */
#table-wrap {
  overflow: auto;
  max-height: calc(100vh - 240px);
  border: 1px solid #ddd;
  background: #fff;
  position: relative;
}
table.bench {
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
  width: max(100%, var(--bench-table-width, 0px));
  min-width: var(--bench-table-width, 0px);
}
table.bench col.test-col-w { width: 360px; }
table.bench col.data-col-w { width: 90px; }
table.bench th, table.bench td {
  border: 1px solid #e3e3e3;
  padding: 4px 8px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.bench thead th {
  position: sticky;
  top: 0;
  background: #f5f5f5;
  z-index: 3;
}
table.bench th.sortable { cursor: pointer; user-select: none; }
table.bench th.sortable:hover { background: #ececec; }
table.bench .sort-ind { color: #aaa; font-size: 10px; margin-left: 2px; }
table.bench .sort-ind.active { color: #333; }
table.bench th.test-col, table.bench td.test-col {
  text-align: left;
  position: sticky;
  left: 0;
  background: #f5f5f5;
  z-index: 5;
  isolation: isolate;
}
table.bench th.test-col::before, table.bench td.test-col::before {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  box-shadow: 1px 0 0 #e3e3e3;
  z-index: -1;
}
table.bench thead th.test-col { z-index: 6; }
table.bench td.databar {
  position: relative;
  background-clip: padding-box;
}
table.bench td.databar .bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(91, 155, 213, 0.35);
  z-index: 0;
}
table.bench td.databar .val {
  position: relative;
  z-index: 1;
}
table.bench tr.row-hl th, table.bench tr.row-hl td { background: #fff5cc !important; }
table.bench th.col-hl, table.bench td.col-hl { background: #fff5cc !important; }
table.bench tr.row-hl td.databar .bar { background: rgba(255, 200, 50, 0.55); }

#single-filter-values { min-width: 180px; }
