.tap {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tap .popup-wrapper {
  position: relative;
}

.tap button {
  flex-shrink: 0;
}

.tap .empty-state a:not(.button) {
  text-decoration: underline;
}

.tap ul {
  list-style: initial;
  margin: 16px 0;
  padding-left: 24px;
}

.tap ul li {
  margin-bottom: 16px;
}

.tap .tap-top-bar {
  padding: 32px 0 0;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
  top: 0;
}

.tap .tap-top-bar.stick {
  position: sticky;
}

.tap.v2 .tap-top-bar {
  border-bottom: none;
}

.tap .inner-top-bar-underlay {
  display: block;
  position: sticky;
  left: 0;
  top: 0;
  width: 100%;
  z-index: 1;
}

.tap .inner-top-bar-underlay::before {
  display: block;
  content: "";
  position: absolute;
  height: 72px;
  width: calc(100% + 64px);
  margin-left: -32px;
  background: white;
  border-bottom: 1px solid #eee;
  z-index: 1;
  opacity: 0.95;
}

.tap .tap-header-left-section {
  display: flex;
  gap: 16px;
  align-items: center;
}

.tap .tap-header-left-section > * {
  flex-shrink: 0;
}

.tap .target-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  padding-bottom: 32px;
}

.tap.v2 .target-controls {
  padding-bottom: 8px;
}

.tap .repo-picker {
  max-width: 300px;
}

.tap .tap-header-group {
  margin-bottom: 16px;
}

.tap .tap-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.tap-title {
  font-size: 32px;
  font-weight: 700;
  flex-shrink: 0;
}

.tap .tabs {
  margin-top: 8px;
}

.tap .inner-top-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-bottom: 4px;
}

.tap .tap-grid-container {
  overflow: auto;
  /* Workaround to disable repaint-on-scroll for scrollable flex child,
     which causes bad scroll performance. */
  backface-visibility: hidden;
  flex-grow: 1;
}

/* Workaround to add bottom padding to a scrollable flex child. */
.tap .tap-grid-container::after {
  content: "";
  display: block;
  height: 32px;
}

.tap .tap-row {
  display: flex;
  align-items: center;
}

.tap .commit-timeline-label {
  color: #757575;
  position: sticky;
  top: 0;
  left: 0;
  height: 0;
  z-index: 1;
}

.tap .hovered-commit-row {
  height: 24px;
}

.tap-hovered-commit-info,
.tap-hovered-commit-pointer {
  position: fixed;
  pointer-events: none;
}

.tap-hovered-commit-info {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  height: 24px;
  background: #eceff1;
  border-radius: 12px;
  height: inherit;
  padding: 2px 8px;
}

.tap-hovered-commit-pointer {
  width: 0;
  height: 0;
  overflow: visible;
}

.tap-hovered-commit-pointer::before {
  content: "";
  display: block;
  background: #eceff1;
  width: 12px;
  height: 12px;
  transform-origin: center;
  transform: translateX(-50%) translateY(-50%) rotate(45deg);
  z-index: -1;
}

.tap .commit-timeline {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Workaround for padding-right not working within horizontally scrollable flex child */
.tap .commit-timeline::after {
  content: "";
  display: block;
  width: 16px;
  height: 1px;
  flex-shrink: 0;
}

.tap .commits-list {
  display: inline-flex;
  align-items: center;
  margin: 4px 0; /* to match "Load more" button height */
  position: relative;
}

.tap .commits-list::before {
  content: "";
  display: block;
  position: absolute;
  top: 15px;
  height: 3px;
  left: 0;
  right: 0;
  background: #cfd8dc;
  margin-left: 17px; /* = half of effective .commit-link size */
}

.tap .commit-link {
  width: 32px;
  height: 32px;
  padding: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tap .commit-link::after {
  content: "";
  display: block;
  border-radius: 50%;
  width: 8px;
  height: 8px;
  position: absolute;
  z-index: 1;
  background: white;
  border: 2px solid #212121;
}

.tap .commit-link:hover::after {
  background: #9e9e9e;
  border-color: #9e9e9e;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.tap-target-label {
  font-size: 0.8em;
  color: #444;
  margin-top: 8px;
  margin-bottom: 2px;
  position: sticky;
  left: 0;
}

.tap-target-path {
  color: #888;
}

.tap-target-name {
  font-weight: 600;
}

.tap-target-type {
  color: #aaa;
}

.tap-target-stats {
  margin-left: 8px;
  color: #aaa;
}

.tap .tap-block {
  display: flex;
  margin: 1px;
  border-radius: 2px;
  box-sizing: border-box;
  font-size: 8px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.8;
  flex-grow: 1;
  position: relative;
  min-width: 6px;
  min-height: 6px;
}

.tap-block svg {
  color: #fff;
  width: 50%;
  height: 50%;
}

.tap .tap-block:hover,
.tap .tap-block:first-of-type {
  opacity: 1;
}

.tap .tap-block:nth-of-type(2) {
  opacity: 0.95;
}

.tap .tap-block:nth-of-type(3) {
  opacity: 0.9;
}

.tap .tap-block:nth-of-type(4) {
  opacity: 0.85;
}

.tap .tap-block.no-status {
  border: 1px solid #e0e0e0;
}

.tap .tap-block.timing {
  background-color: #0d47a1;
}

/* 
STATUS_UNSPECIFIED = 0;
BUILDING = 1;
BUILT = 2;
FAILED_TO_BUILD = 3;
TESTING = 4;
PASSED = 5;
FAILED = 6;
TIMED_OUT = 7;
CANCELLED = 8;
TOOL_FAILED = 9;
INCOMPLETE = 10;
FLAKY = 11;
UNKNOWN = 12;
SKIPPED = 13; 
*/

.tap-commit-container {
  display: flex;
  flex-direction: column;
  width: 32px;
  height: 32px;
  flex-grow: 0;
  flex-shrink: 0;
  overflow: hidden;
  margin: 1px;
}

.tap .tap-invocation-count {
  position: absolute;
  bottom: 1px;
  right: 2px;
  color: #fff;
}

.tap .tap-block-header {
  border: 1px solid #ccc;
  color: #888;
}

.tap .tap-block-header:first-of-type {
  border: 1px solid #888;
  color: #444;
}

.tap .tap-block.cached {
  opacity: 0.5;
}
.tap .tap-block.status-0 {
  background-color: #888;
}

.tap .tap-block.status-1 {
  background-color: #2196f3;
}

.tap .tap-block.status-2 {
  background-color: #0d47a1;
}

.tap .tap-block.status-3 {
  background-color: #212121;
}

.tap .tap-block.status-4 {
  background-color: #1976d2;
}

.tap .tap-block.status-5 {
  background-color: #4caf50;
}

.tap .tap-block.status-6 {
  background-color: #f44336;
}

.tap .tap-block.status-7 {
  background-color: #616161;
}

.tap .tap-block.status-8 {
  background-color: #757575;
}

.tap .tap-block.status-9 {
  background-color: #212121;
}

.tap .tap-block.status-10 {
  background-color: #888;
}

.tap .tap-block.status-11 {
  background-color: #ff9800;
}

.tap .tap-block.status-12 {
  background-color: #888;
}

.tap .tap-block.status-13 {
  background-color: #888;
}

.tap .filter-input {
  vertical-align: middle;
  margin-left: 8px;
}

.tap .filter {
  margin-top: 0;
}

.tap label {
  padding-left: 8px;
  vertical-align: middle;
  user-select: none;
}

.tap .group {
  display: flex;
  align-items: baseline;
}

.tap .group-container {
  background-color: #fafafa;
  border: 1px solid #eee;
  padding: 4px 16px 4px 0;
  min-height: 40px;
  box-sizing: border-box;
  border-radius: 4px;
  flex-grow: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.tap .more-targets-button {
  width: 100%;
  justify-content: center;
  padding: 24px 0;
  margin-top: 24px;
  border-radius: 8px;
  position: sticky;
  left: 0;
}

.tap .more-invocations-button {
  gap: 8px;
}

.tap-sort-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  grid-gap: 8px;
}

.tap-sort-title {
  margin-right: 8px;
}

.tap-sort-control {
  display: flex;
  align-items: center;
  margin-left: 8px;
}

.tap .chart-card {
  margin-top: 0;
  display: block;
}

.tap .flakes-chart-header {
  margin: 0 0 16px;
}

.tap .flakes-list-header {
  margin: 16px 0;
}

.tap .flake-table {
  margin-top: 16px;
}

.tap .flake-table-row {
  display: flex;
  border-top: 1px solid #eee;
  padding: 16px 0;
}

.tap .flake-table-row:last-child {
  border-bottom: 1px solid #eee;
}

.tap .flake-table-row:hover {
  background: #fafafa;
}

.tap .flake-table-row.flake-table-summary-row {
  border: none;
  background: transparent;
  padding-top: 0;
}

.tap .flake-table-row-image {
  margin-left: 4px;
  margin-right: 16px;
}

.tap .flake-table-row-header {
  font-weight: 600;
}

.tap .flake-table-row-content {
  flex-grow: 1;
}

.tap .flake-table-row-stats {
  display: flex;
  justify-content: space-between;
}

.tap .flake-stat {
  width: 160px;
  margin: 8px 0;
  font-size: 16px;
}

.tap .flake-stat-value {
  font-size: 20px;
}

.tap .flake-table-header {
  display: flex;
  justify-content: space-between;
  grid-gap: 8px;
}

.tap .flake-table-sort-controls {
  display: flex;
  align-items: center;
  min-width: 300px;
}

/* Some weird padding and margin to make the click target bigger. */
.tap .target-copy-button .copy-icon-wrapper {
  display: inline-block;
  padding: 16px 16px 16px 8px;
  margin: -16px -16px -16px -4px;
}

.tap .target-copy-button .copy-button-text {
  margin-left: 4px;
  font-weight: normal;
  font-size: 14px;
  color: #888;
}

.tap .flakes-list .test-case-info {
  padding-left: 0;
  border-left: none;
}
