:root {
  --bg: #f6f4ef;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e5e4;
  --card: #fffdf8;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 14px/1.5 "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
header { padding: 28px 28px 8px; }
h1 { font-size: 22px; margin: 0 0 6px; }
.sub { color: var(--muted); }
main { padding: 0 28px 40px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid .wide { grid-column: 1 / -1; }
@media (max-width: 960px) { .grid { grid-template-columns: 1fr; } }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
h2 { font-size: 15px; margin: 0 0 12px; }
canvas { width: 100%; height: 280px; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; }
.legend label { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); }
.criterion {
  display: inline;
  border-bottom: 1px dotted var(--muted);
  cursor: help;
}
[data-desc] { cursor: help; }
#desc-tip {
  position: fixed;
  z-index: 30;
  min-width: 12em;
  max-width: min(28em, 70vw);
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(28, 25, 23, 0.12);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  pointer-events: none;
}
#desc-tip[hidden] { display: none; }
.swatch { width: 10px; height: 10px; border-radius: 999px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td {
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
td.wrap { white-space: normal; min-width: 14em; max-width: 28em; }
th { color: var(--muted); font-weight: 600; }
.th-head { display: inline-flex; align-items: center; gap: 4px; }
.col-filter {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0 2px;
  font-size: 11px;
  line-height: 1;
}
.col-filter.is-on { color: #1d4ed8; }
#col-filter-pop {
  position: fixed;
  z-index: 30;
  width: 240px;
  max-width: calc(100vw - 24px);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(28, 25, 23, 0.12);
  font-size: 12px;
}
#col-filter-pop[hidden] { display: none; }
#col-filter-pop input {
  width: 100%;
  margin-bottom: 6px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}
#col-filter-pop .col-filter-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}
#col-filter-pop .col-filter-actions button {
  border: 0;
  background: none;
  color: #1d4ed8;
  cursor: pointer;
  padding: 0;
  font: inherit;
}
#col-filter-pop .col-filter-list {
  max-height: 240px;
  overflow: auto;
}
#col-filter-pop .col-filter-list label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 2px 0;
  cursor: pointer;
  white-space: normal;
  font-weight: 400;
  color: var(--ink);
}
.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 24px 0; }
a { color: #1d4ed8; }
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}
.filter-bar input[type="search"] {
  width: min(480px, 100%);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: var(--card);
}
.label-limit {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  white-space: nowrap;
}
.label-limit input {
  width: 4.5em;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: var(--card);
}
.chart-tip {
  position: fixed;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 280px;
  max-width: min(460px, calc(100vw - 24px));
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(28, 25, 23, 0.12);
  font-size: 12px;
}
.chart-tip[hidden] { display: none; }
.chart-tip-body { margin: 0; display: grid; grid-template-columns: 6.2em 1fr; gap: 2px 10px; }
.chart-tip-body dt { color: var(--muted); }
.chart-tip-body dd { margin: 0; font-variant-numeric: tabular-nums; word-break: break-all; }
.chart-tip-body dd.main { font-weight: 600; }
.chart-tip-body dd.fail { color: #be123c; }
.chart-tip-body dd.up { color: #047857; }
.chart-tip-body dd.down { color: #be123c; }
.chart-tip-body dd.flat { color: var(--muted); }
#summary-table tr.is-hit td { background: #fde68a; }
#summary-table tr.is-hit { outline: 2px solid #d97706; outline-offset: -2px; }
#summary-table tr.is-filtered-out,
#files-table tr.is-filtered-out { display: none; }
