:root {
  --accent: #3b5b8c;
  --accent-soft: #9fb3d1;
}

body {
  font-family: system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  max-width: 720px;
  margin: 40px auto;
  padding: 0 16px;
  color: #222;
  background: #fff;
}

h1 {
  font-size: 26px;
  margin-bottom: 8px;
}

h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  margin: 40px 0 12px;
}

nav {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}

nav a {
  color: #888;
  text-decoration: none;
  margin-right: 16px;
}

nav a.here {
  color: var(--accent);
  font-weight: 700;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

.why {
  font-size: 16px;
  color: #444;
  max-width: 800px;
}

li::marker {
  color: var(--accent-soft);
}

ul {
  padding-left: 22px;
}

li {
  margin: 2px 0;
}

.item {
  margin-bottom: 14px;
}

.name {
  font-family: ui-monospace, monospace;
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
}

.summary {
  font-size: 16px;
  margin-left: 22px;
}

.notes {
  margin-left: 16px;
}

.details {
  margin: 4px 0 0;
  font-size: 14px;
  color: #666;
}

.detail-name {
  font-family: ui-monospace, monospace;
  font-size: 13px;
  color: #222;
}


body.wide {
  max-width: none;
  margin-left: 32px;
  margin-right: 32px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}

th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  font-weight: 600;
  border-bottom: 2px solid var(--accent-soft);
  padding: 6px 12px 6px 0;
}

td {
  vertical-align: top;
  border-bottom: 1px solid #eee;
  padding: 8px 12px 8px 0;
}

td.code {
  font-family: ui-monospace, monospace;
  font-size: 13px;
}

/* A date and time reads badly broken across lines, so it never wraps */

.stamp {
  white-space: nowrap;
}

/* A column only as wide as what's in it, leaving the rest of the row to the others */

.snug {
  width: 1%;
  white-space: nowrap;
}

td.score {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stopped {
  color: #b45309;
}

pre.file,
pre.log {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  background: #f8fafc;
  border: 1px solid #eee;
  padding: 8px 12px;
  overflow: auto;
}

pre.log {
  max-height: 480px;
}

.charts {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

/* Three panels held on one row, so the middle one changes in place */

.walk {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.curve {
  color: var(--accent);
}

.curve text {
  font-size: 11px;
  fill: #888;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 4px 0 24px 40px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}

.swatch {
  display: inline-block;
  width: 12px;
  height: 3px;
  margin-right: 6px;
  vertical-align: middle;
}

.count {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 8px;
}

.crumbs {
  font-size: 13px;
  color: #888;
}

.crumbs a {
  color: var(--accent);
}

.popup {
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 12px 16px;
  min-width: 480px;
  max-width: 80vw;
}

.popup::backdrop {
  background: rgba(15, 23, 42, 0.3);
}

.popup-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.popup pre.file {
  margin: 0;
  max-height: 70vh;
}

tr.group td {
  background: #f1f5f9;
  font-weight: 600;
  cursor: pointer;
}

td.child {
  padding-left: 24px;
}

td.none {
  padding-left: 24px;
  color: #999;
}

/* display on the class would otherwise beat the browser's own rule for hidden */

.task-choice[hidden] {
  display: none;
}

.task-choice {
  display: block;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  padding: 2px 0;
  white-space: nowrap;
}

.dropdown {
  display: inline-block;
  position: relative;
}

.dropdown summary {
  cursor: pointer;
  list-style: none;
  border: 1px solid #ccc;
  border-radius: 3px;
}

.dropdown summary::after {
  content: " ▾";
}

.dropdown-panel {
  position: absolute;
  z-index: 20;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 8px 12px;
  margin-top: 4px;
}

.dropdown-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  white-space: nowrap;
}

.note-label {
  font-size: 13px;
  color: #666;
  cursor: default;
  white-space: nowrap;
}

.shape {
  font-size: 13px;
  color: #888;
}

.running {
  color: #15803d;
  font-weight: 600;
}

.fast {
  font-size: 12px;
  color: #b45309;
}

.note {
  font-size: 14px;
  color: #666;
  max-width: 720px;
}

.filters {
  margin: 16px 0;
}

/* A little room below each filter too, so a row that wraps doesn't sit on the one
   above */

.filter {
  font-family: ui-monospace, monospace;
  font-size: 13px;
  margin: 0 8px 5px 0;
  padding: 3px 6px;
}

.scroll {
  overflow-x: auto;
}

th,
td {
  border-right: 1px solid #eee;
  padding-left: 10px;
  padding-right: 10px;
}

th:last-child,
td:last-child {
  border-right: none;
}

tbody tr[data-id] {
  cursor: pointer;
}

tbody tr[data-id]:hover {
  background: #f8fafc;
}

tbody tr.selected {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: #eef2f8;
}

/* Cells hold names that read badly broken, but a heading can wrap, which keeps a
   column as wide as its numbers rather than as wide as its name */

.results td {
  white-space: nowrap;
}

/* A heading longer than anything under it, held narrow so it wraps rather than
   widening the column */

.results th.narrow {
  max-width: 5em;
}

.results th.number,
.results td.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

th.sortable {
  cursor: pointer;
}

td.icons {
  text-align: center;
  color: var(--accent);
}

.results td.checks {
  color: #a16207;
}

.icon {
  margin: 0 2px;
}

.tip {
  position: fixed;
  z-index: 100;
  max-width: min(640px, calc(100vw - 16px));
  background: #475569;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-family: system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0;
  text-align: left;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: pre-wrap;
  pointer-events: none;
}

.trash {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 15px;
  padding: 0;
  opacity: 0;
}

tr:hover .trash {
  opacity: 0.6;
}

.trash:hover {
  opacity: 1;
}

/* The bar that makes a comparison of the runs picked on the Runs page */

.compare {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 8px 0 16px;
  padding: 8px 12px;
  border: 1px solid var(--accent-soft);
  border-radius: 6px;
}

.compare[hidden] {
  display: none;
}

.compare input:not([type]) {
  flex: 1;
  min-width: 240px;
}

/* A read-only copy of the IDE refuses changes, so it hides the controls that make them */

[data-read-only] .changes {
  display: none;
}

/* A row's details, opened under it, set apart from the rows around them */

tr.opened > td {
  background: #f7f8fa;
  padding: 4px 16px 8px 32px;
}

/* A yes or no shown as a mark rather than a word */

.yes {
  color: #2e7d32;
  font-weight: bold;
}

.no {
  color: #c62828;
  font-weight: bold;
}

/* How a run came out against a comparison's reference */

.ahead {
  color: #2e7d32;
}

.behind {
  color: #c62828;
}

.tie {
  color: #888;
}

/* A finding's main point, first and in bold, so it reads before anything else */

.takeaway {
  font-weight: 600;
  font-size: 15px;
  margin: 4px 0 10px;
}

.add-title {
  width: 420px;
  max-width: 100%;
}

.board {
  table-layout: fixed;
}

.board td.column {
  height: 120px;
  padding-top: 10px;
  border-bottom: none;
}

/* A column a card is dragged over, so it's clear where the card will land */

.board td.column.over {
  background: #eef2f8;
}

/* Where in the column a dragged card will land */

.drop-line {
  height: 3px;
  margin: 2px 0;
  border-radius: 2px;
  background: #3b5b8c;
}

.card {
  background: #fff;
  border: 1px solid #e3e6eb;
  padding: 8px 10px;
  margin-bottom: 8px;
  cursor: grab;
}

.card:hover {
  background: #f8fafc;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

/* The board is one table row, so a card's trash shows on hovering the card, not the row */

.board tr:hover .trash {
  opacity: 0;
}

.board .card:hover .trash {
  opacity: 0.6;
}

.board .card .trash:hover {
  opacity: 1;
}

.card-detail {
  margin-top: 6px;
  font-size: 13px;
  color: #555;
  white-space: pre-wrap;
}

.card-file {
  margin-top: 6px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: #888;
}
