/* Self-contained styles. The small subset of Bootstrap this site used
   (navbar, container, alert, badge, table) is reimplemented below. */

:root {
  --navbar-height: 40px;
  --border-color: #dee2e6;
  --status-ok: #F0FFF0;
  --status-fail: #FF9090;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding-top: calc(var(--navbar-height) + 10px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
}

a {
  color: #0d6efd;
}

a:hover {
  color: #0a58ca;
}

.container-fluid {
  width: 100%;
  max-width: 1200px;
  margin-right: auto;
  margin-left: auto;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
}

/* Navbar */

.navbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1030;
  height: var(--navbar-height);
  background-color: #f8f9fa;
}

.navbar .container-fluid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.navbar-brand {
  font-size: 1.25rem;
  color: rgba(0, 0, 0, 0.9);
  text-decoration: none;
  white-space: nowrap;
}

.navbar-nav {
  display: flex;
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.nav-link {
  display: block;
  padding: 0.5rem;
  color: rgba(0, 0, 0, 0.55);
  text-decoration: none;
}

.nav-link:hover {
  color: rgba(0, 0, 0, 0.7);
}

/* Alert */

.alert {
  padding: 1rem;
  margin: 1rem 0;
  border: 1px solid transparent;
  border-radius: 0.375rem;
}

.alert-info {
  color: #055160;
  background-color: #cff4fc;
  border-color: #b6effb;
}

/* Badge */

.badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
}

.text-bg-danger {
  color: #fff;
  background-color: #dc3545;
}

.text-bg-info {
  color: #000;
  background-color: #0dcaf0;
}

/* Table */

.table {
  width: 100%;
  margin-bottom: 1rem;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.5rem;
  text-align: left;
}

.table-bordered th,
.table-bordered td {
  border: 1px solid var(--border-color);
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.05);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

@media screen and (max-width: 767px) {
  .table-responsive-border {
    border: 1px solid var(--border-color);
  }
  .table-responsive-border > .table {
    margin-bottom: 0;
  }

  .table-responsive {
    margin-bottom: 15px;
    overflow-y: hidden;
  }

  .table-responsive > .table :is(th, td) {
    white-space: nowrap;
  }

  /* The wrapper draws the outer border, so drop the cells' edge borders. */
  .table-responsive > .table-bordered {
    border: 0;
  }
  .table-responsive > .table-bordered :is(th, td):first-child {
    border-left: 0;
  }
  .table-responsive > .table-bordered :is(th, td):last-child {
    border-right: 0;
  }
  .table-responsive > .table-bordered > :is(tbody, tfoot) > tr:last-child :is(th, td) {
    border-bottom: 0;
  }
}

/* Reports table */

table.reports th, table.reports td {
  padding: 1px;
}

table.reports tr.branch-separator td {
  border-top: solid 2px black;
}

table.reports td.datetime {
  text-align: center;
}

table.reports td.branch {
  text-align: center;
}

table.reports td.revision {
  font-family: Menlo, monospace;
  text-align: center;
}

/* :where() keeps the second :nth-child out of the specificity, so this
   ties with the td.summary rules below and they win by source order. */
table.reports td:nth-child(n+6):where(:nth-child(-n+9)) {
  background-color: var(--status-fail);
}

table.reports td:nth-child(n+6):where(:nth-child(-n+9)):empty {
  background-color: var(--status-ok);
}

table.reports td.summary {
  background-color: var(--status-ok);
}

table.reports td.summary div {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  width: 250px;
}

table.reports td.summary.failure {
  background-color: var(--status-fail);
}

table.reports td.diff div {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  width: 100px;
}
